public SongsController(IFreeSql fsql, GuidRepository <Song> repos1, GuidRepository <xxxx> repos2, DefaultRepository <Song, int> repos11, DefaultRepository <xxxx, int> repos21, BaseRepository <Song> repos3, BaseRepository <Song, int> repos4, IBasicRepository <Song> repos31, IBasicRepository <Song, int> repos41, IReadOnlyRepository <Song> repos311, IReadOnlyRepository <Song, int> repos411, SongRepository reposSong ) { _songRepository = repos4; //test code var curd1 = fsql.GetRepository <Song, int>(); var curd2 = fsql.GetRepository <Song, string>(); var curd3 = fsql.GetRepository <Song, Guid>(); var curd4 = fsql.GetGuidRepository <Song>(); Console.WriteLine(repos1.Select.ToSql()); Console.WriteLine(reposSong.Select.ToSql()); Console.WriteLine(repos2.Select.ToSql()); Console.WriteLine(repos21.Select.ToSql()); using (reposSong.DataFilter.DisableAll()) { Console.WriteLine(reposSong.Select.ToSql()); } }
protected override ValidationResult IsValid(object value, ValidationContext validationContext) { var input = Convert.ToString(value, CultureInfo.CurrentCulture); // let the Required attribute take care of this validation if (string.IsNullOrWhiteSpace(input)) { return(null); } // get all of your guids (assume a repo is being used) var guids = new GuidRepository().AllGuids(); Guid guid; if (!Guid.TryParse(input, out guid)) { // not a validstring representation of a guid return(new ValidationResult(FormatErrorMessage(validationContext.DisplayName))); } // is the passed guid one we know about? return(guids.Any(g => g == guid) ? new ValidationResult(FormatErrorMessage(validationContext.DisplayName)) : null); }
public UserLikeController(IMapper mapper, ICurrentUser currentUser, GuidRepository <TagArticle> tagArticleRepository, IFreeSql freeSql, IArticleService articleService, AuditBaseRepository <UserLike> userLikeRepository, AuditBaseRepository <Article> articleAuditBaseRepository, AuditBaseRepository <Comment> commentRepository) { _mapper = mapper; _currentUser = currentUser; _userLikeRepository = userLikeRepository; _articleAuditBaseRepository = articleAuditBaseRepository; _commentRepository = commentRepository; }
public IBaseRepository <TEntity, Guid> GetGuidRepository <TEntity>(Expression <Func <TEntity, bool> > filter = null, Func <string, string> asTable = null) where TEntity : class { var repo = new GuidRepository <TEntity>(_fsql, filter, asTable) { UnitOfWork = this }; return(repo); }
public ArticleController(AuditBaseRepository <Article> articleRepository, IMapper mapper, ICurrentUser currentUser, GuidRepository <TagArticle> tagArticleRepository, IArticleService articleService) { _articleRepository = articleRepository; _mapper = mapper; _currentUser = currentUser; _tagArticleRepository = tagArticleRepository; _articleService = articleService; }
public ArticleController(AuditBaseRepository <Article> articleRepository, IMapper mapper, ICurrentUser currentUser, GuidRepository <TagArticle> tagArticleRepository, IArticleService articleService, BaseRepository <UserSubscribe> userSubscribeRepository, ICapPublisher capBus) { _articleRepository = articleRepository; _mapper = mapper; _currentUser = currentUser; _tagArticleRepository = tagArticleRepository; _articleService = articleService; _userSubscribeRepository = userSubscribeRepository; _capBus = capBus; }
public ArticleAppService( AuditBaseRepository <Article> articleRepository, GuidRepository <TagArticle> tagArticleRepository, IMapper mapper, ICurrentUser currentUser, AuditBaseRepository <UserLike> userLikeRepository, AuditBaseRepository <Comment> commentBaseRepository, IClassifyService classifyService, ITagService tagService) { _articleRepository = articleRepository; _tagArticleRepository = tagArticleRepository; _mapper = mapper; _currentUser = currentUser; _userLikeRepository = userLikeRepository; _commentBaseRepository = commentBaseRepository; _classifyService = classifyService; this.tagService = tagService; }
public SongsController(IFreeSql fsql, GuidRepository <Song> repos1, GuidRepository <xxxx> repos2, DefaultRepository <Song, int> repos11, DefaultRepository <xxxx, int> repos21, BaseRepository <Song> repos3, BaseRepository <Song, int> repos4, IBasicRepository <Song> repos31, IBasicRepository <Song, int> repos41, IReadOnlyRepository <Song> repos311, IReadOnlyRepository <Song, int> repos411 ) { _songRepository = repos4; //test code var curd1 = fsql.GetRepository <Song, int>(); var curd2 = fsql.GetRepository <Song, string>(); var curd3 = fsql.GetRepository <Song, Guid>(); var curd4 = fsql.GetGuidRepository <Song>(); }
public GuidService(Func <DateTimeOffset> now, GuidRepository guidRepository) { this.now = now; this.guidRepository = guidRepository; }
public GuidsController(GuidRepository guidRepo) { GuidRepo = guidRepo; }