No Description

IRepository.cs 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //
  2. // IRepository.cs
  3. //
  4. // Author:
  5. // Bryan Allred <bryan.allred@gmail.com>
  6. //
  7. // Copyright (c) 2011 Bryan Allred
  8. //
  9. // Permission is hereby granted, free of charge, to any person obtaining a copy
  10. // of this software and associated documentation files (the "Software"), to deal
  11. // in the Software without restriction, including without limitation the rights
  12. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13. // copies of the Software, and to permit persons to whom the Software is
  14. // furnished to do so, subject to the following conditions:
  15. //
  16. // The above copyright notice and this permission notice shall be included in
  17. // all copies or substantial portions of the Software.
  18. //
  19. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  24. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  25. // THE SOFTWARE.
  26. using System;
  27. using System.Collections.Generic;
  28. namespace WhiteNoise.Domain.Abstract
  29. {
  30. /// <summary>
  31. /// Repository base interface.
  32. /// </summary>
  33. public interface IRepository<T>
  34. {
  35. /// <summary>
  36. /// Gets the collection.
  37. /// </summary>
  38. /// <value>
  39. /// The collection.
  40. /// </value>
  41. IList<T> Collection { get; }
  42. /// <summary>
  43. /// Add the specified member.
  44. /// </summary>
  45. /// <param name='member'>
  46. /// Member.
  47. /// </param>
  48. T Add(T member);
  49. /// <summary>
  50. /// Find the specified id.
  51. /// </summary>
  52. /// <param name='id'>
  53. /// Identifier.
  54. /// </param>
  55. T Find(int id);
  56. /// <summary>
  57. /// Remove the specified member.
  58. /// </summary>
  59. /// <param name='member'>
  60. /// Member.
  61. /// </param>
  62. T Remove(T member);
  63. /// <summary>
  64. /// Update the specified member.
  65. /// </summary>
  66. /// <param name='member'>
  67. /// Member.
  68. /// </param>
  69. T Update(T member);
  70. }
  71. }