/test/Util.Tests/Samples/RepositorySample.cs

https://github.com/dotnetcore/Util
C# | 315 lines | 227 code | 73 blank | 15 comment | 0 complexity | e49c2afc3c2272c306b6095373bfd099 MD5 | raw file
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.ComponentModel.DataAnnotations;
  5. using System.Linq;
  6. using System.Linq.Expressions;
  7. using System.Threading;
  8. using System.Threading.Tasks;
  9. using AutoMapper;
  10. using Util.Domains;
  11. using Util.Domains.Repositories;
  12. namespace Util.Tests.Samples {
  13. /// <summary>
  14. /// 实体样例
  15. /// </summary>
  16. [DisplayName( "实体样例" )]
  17. public class EntitySample : AggregateRoot<EntitySample> {
  18. public EntitySample( ) : this( Guid.NewGuid() ) {
  19. }
  20. public EntitySample( Guid id ) : base( id ) {
  21. }
  22. /// <summary>
  23. /// 名称
  24. /// </summary>
  25. [Required(ErrorMessage = "名称不能为空")]
  26. public string Name { get; set; }
  27. /// <summary>
  28. /// 忽略值
  29. /// </summary>
  30. [IgnoreMap]
  31. public string IgnoreValue { get; set; }
  32. }
  33. /// <summary>
  34. /// 仓储样例
  35. /// </summary>
  36. public interface IRepositorySample : IRepository<EntitySample> {
  37. }
  38. /// <summary>
  39. /// 仓储样例
  40. /// </summary>
  41. public class RepositorySample : IRepositorySample {
  42. public IQueryable<EntitySample> Find() {
  43. throw new NotImplementedException();
  44. }
  45. public IQueryable<EntitySample> FindAsNoTracking() {
  46. throw new NotImplementedException();
  47. }
  48. public IQueryable<EntitySample> Find( ICriteria<EntitySample> criteria ) {
  49. throw new NotImplementedException();
  50. }
  51. public IQueryable<EntitySample> Find( Expression<Func<EntitySample, bool>> predicate ) {
  52. throw new NotImplementedException();
  53. }
  54. public EntitySample Find( object id ) {
  55. return new EntitySample();
  56. }
  57. public Task<EntitySample> FindAsync( object id ) {
  58. throw new NotImplementedException();
  59. }
  60. public List<EntitySample> FindByIds( params Guid[] ids ) {
  61. throw new NotImplementedException();
  62. }
  63. public List<EntitySample> FindByIds( IEnumerable<Guid> ids ) {
  64. throw new NotImplementedException();
  65. }
  66. public List<EntitySample> FindByIds( string ids ) {
  67. throw new NotImplementedException();
  68. }
  69. public Task<List<EntitySample>> FindByIdsAsync( params Guid[] ids ) {
  70. throw new NotImplementedException();
  71. }
  72. public Task<List<EntitySample>> FindByIdsAsync( IEnumerable<Guid> ids, CancellationToken cancellationToken = default( CancellationToken ) ) {
  73. throw new NotImplementedException();
  74. }
  75. public Task<List<EntitySample>> FindByIdsAsync( IEnumerable<Guid> ids ) {
  76. throw new NotImplementedException();
  77. }
  78. public Task<List<EntitySample>> FindByIdsAsync( string ids ) {
  79. throw new NotImplementedException();
  80. }
  81. public EntitySample Single( Expression<Func<EntitySample, bool>> predicate ) {
  82. throw new NotImplementedException();
  83. }
  84. public Task<EntitySample> SingleAsync( Expression<Func<EntitySample, bool>> predicate, CancellationToken cancellationToken = default( CancellationToken ) ) {
  85. throw new NotImplementedException();
  86. }
  87. public List<EntitySample> FindAll( Expression<Func<EntitySample, bool>> predicate = null ) {
  88. throw new NotImplementedException();
  89. }
  90. public Task<List<EntitySample>> FindAllAsync( Expression<Func<EntitySample, bool>> predicate = null ) {
  91. throw new NotImplementedException();
  92. }
  93. public bool Exists( Expression<Func<EntitySample, bool>> predicate ) {
  94. throw new NotImplementedException();
  95. }
  96. public bool Exists( params Guid[] ids ) {
  97. throw new NotImplementedException();
  98. }
  99. public Task<bool> ExistsAsync( Expression<Func<EntitySample, bool>> predicate ) {
  100. throw new NotImplementedException();
  101. }
  102. public Task<bool> ExistsAsync( params Guid[] ids ) {
  103. throw new NotImplementedException();
  104. }
  105. public int Count( Expression<Func<EntitySample, bool>> predicate = null ) {
  106. throw new NotImplementedException();
  107. }
  108. public Task<int> CountAsync( Expression<Func<EntitySample, bool>> predicate = null ) {
  109. throw new NotImplementedException();
  110. }
  111. public List<EntitySample> Query( IQueryBase<EntitySample> query ) {
  112. throw new NotImplementedException();
  113. }
  114. public Task<List<EntitySample>> QueryAsync( IQueryBase<EntitySample> query ) {
  115. throw new NotImplementedException();
  116. }
  117. public List<EntitySample> QueryAsNoTracking( IQueryBase<EntitySample> query ) {
  118. throw new NotImplementedException();
  119. }
  120. public Task<List<EntitySample>> QueryAsNoTrackingAsync( IQueryBase<EntitySample> query ) {
  121. throw new NotImplementedException();
  122. }
  123. public PagerList<EntitySample> PagerQuery( IQueryBase<EntitySample> query ) {
  124. throw new NotImplementedException();
  125. }
  126. public Task<PagerList<EntitySample>> PagerQueryAsync( IQueryBase<EntitySample> query ) {
  127. throw new NotImplementedException();
  128. }
  129. public PagerList<EntitySample> PagerQueryAsNoTracking( IQueryBase<EntitySample> query ) {
  130. throw new NotImplementedException();
  131. }
  132. public Task<PagerList<EntitySample>> PagerQueryAsNoTrackingAsync( IQueryBase<EntitySample> query ) {
  133. throw new NotImplementedException();
  134. }
  135. public IQueryable<EntitySample> OrderBy( IQueryable<EntitySample> queryable, string orderBy ) {
  136. throw new NotImplementedException();
  137. }
  138. public void Add( EntitySample entity ) {
  139. }
  140. public void Add( IEnumerable<EntitySample> entities ) {
  141. throw new NotImplementedException();
  142. }
  143. public Task AddAsync( EntitySample entity, CancellationToken cancellationToken = default( CancellationToken ) ) {
  144. throw new NotImplementedException();
  145. }
  146. public Task AddAsync( IEnumerable<EntitySample> entities, CancellationToken cancellationToken = default( CancellationToken ) ) {
  147. throw new NotImplementedException();
  148. }
  149. public Task AddAsync( EntitySample entity ) {
  150. throw new NotImplementedException();
  151. }
  152. public Task AddAsync( IEnumerable<EntitySample> entities ) {
  153. throw new NotImplementedException();
  154. }
  155. public void Update( EntitySample entity ) {
  156. }
  157. public void Update( IEnumerable<EntitySample> entities ) {
  158. throw new NotImplementedException();
  159. }
  160. public Task UpdateAsync( EntitySample entity ) {
  161. throw new NotImplementedException();
  162. }
  163. public Task UpdateAsync( IEnumerable<EntitySample> entities ) {
  164. throw new NotImplementedException();
  165. }
  166. public void Remove( Guid id ) {
  167. throw new NotImplementedException();
  168. }
  169. public Task RemoveAsync( Guid id, CancellationToken cancellationToken = default( CancellationToken ) ) {
  170. throw new NotImplementedException();
  171. }
  172. public Task RemoveAsync( Guid id ) {
  173. throw new NotImplementedException();
  174. }
  175. public void Remove( object id ) {
  176. throw new NotImplementedException();
  177. }
  178. public void Remove( EntitySample entity ) {
  179. throw new NotImplementedException();
  180. }
  181. public Task RemoveAsync( object id, CancellationToken cancellationToken = default( CancellationToken ) ) {
  182. throw new NotImplementedException();
  183. }
  184. public Task RemoveAsync( EntitySample entity, CancellationToken cancellationToken = default( CancellationToken ) ) {
  185. throw new NotImplementedException();
  186. }
  187. public Task RemoveAsync( EntitySample entity ) {
  188. throw new NotImplementedException();
  189. }
  190. public void Remove( IEnumerable<Guid> ids ) {
  191. throw new NotImplementedException();
  192. }
  193. public Task RemoveAsync( IEnumerable<Guid> ids, CancellationToken cancellationToken = default( CancellationToken ) ) {
  194. throw new NotImplementedException();
  195. }
  196. public Task RemoveAsync( IEnumerable<Guid> ids ) {
  197. throw new NotImplementedException();
  198. }
  199. public void Remove( IEnumerable<EntitySample> entities ) {
  200. throw new NotImplementedException();
  201. }
  202. public Task RemoveAsync( IEnumerable<EntitySample> entities, CancellationToken cancellationToken = default( CancellationToken ) ) {
  203. throw new NotImplementedException();
  204. }
  205. public Task RemoveAsync( IEnumerable<EntitySample> entities ) {
  206. throw new NotImplementedException();
  207. }
  208. public Task<EntitySample> FindAsync( object id, CancellationToken cancellationToken = default( CancellationToken ) ) {
  209. throw new NotImplementedException();
  210. }
  211. public EntitySample FindByIdNoTracking( Guid id ) {
  212. throw new NotImplementedException();
  213. }
  214. public Task<EntitySample> FindByIdNoTrackingAsync( Guid id, CancellationToken cancellationToken = default( CancellationToken ) ) {
  215. throw new NotImplementedException();
  216. }
  217. public List<EntitySample> FindByIdsNoTracking( params Guid[] ids ) {
  218. throw new NotImplementedException();
  219. }
  220. public List<EntitySample> FindByIdsNoTracking( IEnumerable<Guid> ids ) {
  221. throw new NotImplementedException();
  222. }
  223. public List<EntitySample> FindByIdsNoTracking( string ids ) {
  224. throw new NotImplementedException();
  225. }
  226. public Task<List<EntitySample>> FindByIdsNoTrackingAsync( params Guid[] ids ) {
  227. throw new NotImplementedException();
  228. }
  229. public Task<List<EntitySample>> FindByIdsNoTrackingAsync( IEnumerable<Guid> ids, CancellationToken cancellationToken = default( CancellationToken ) ) {
  230. throw new NotImplementedException();
  231. }
  232. public Task<List<EntitySample>> FindByIdsNoTrackingAsync( string ids ) {
  233. throw new NotImplementedException();
  234. }
  235. public List<EntitySample> FindAllNoTracking( Expression<Func<EntitySample, bool>> predicate = null ) {
  236. throw new NotImplementedException();
  237. }
  238. public Task<List<EntitySample>> FindAllNoTrackingAsync( Expression<Func<EntitySample, bool>> predicate = null ) {
  239. throw new NotImplementedException();
  240. }
  241. }
  242. }