public ClassTargetBlok(ArticleRole code, string name) : base() { ClassRole = code; ClassName = name; FullClassName = name + NAME_ARTICLE_POSTFIX; ValsClassName = name + NAME_SOURCES_POSTFIX; }
public ClassSourceBlok(SourceBlokBase parent, ArticleRole code, string name) : base(parent) { ClassCode = code; ClassName = name; FullClassName = name + NAME_ARTICLE_POSTFIX; ValsClassName = name + NAME_SOURCES_POSTFIX; }
public ArticleDefinition(ArticleRole article, IList <ArticleParametr> sources, IList <ArticleParametr> results) { Article = article; ArticleSources = sources; ArticleResults = results; }
public ClassArticleResultBlok(ArticleRole code, ArticleDefinition defs, string name) : base() { ClassCode = code; ClassDefs = defs; ClassName = name; FullClassName = name + NAME_ARTICLE_POSTFIX; ValsClassName = name + NAME_SOURCES_POSTFIX; }
public ArticleDefinition(ArticleRole article) { Article = article; ArticleSources = new List <ArticleParametr>(); ArticleResults = new List <ArticleParametr>(); }
public ClassArticleValuesBlok(SourceBlokBase parent, ArticleRole code, ArticleDefinition defs, string name) : base(parent) { ClassCode = code; ClassDefs = defs; ClassName = name; FullClassName = name + NAME_ARTICLE_POSTFIX; ValsClassName = name + NAME_SOURCES_POSTFIX; }
public static ArticleDefinition Create(ArticleRole article, params ArticleParametr[] arg) { IList <ArticleParametr> defnSources = arg.ToList(); IList <ArticleParametr> defnResults = new List <ArticleParametr>(); ArticleDefinition defn = new ArticleDefinition(article, defnSources, defnResults); return(defn); }
public async Task Can_GetGetArticleWithRolesAsync() { var expectedId = Guid.NewGuid(); var expectedTitle = "some title"; var expectedBody = "some body"; var expectedTimestamp = DateTime.ParseExact("01.02.2020", "dd.MM.yyyy", null); var article = new Blog.Domain.Article(); article.Id = expectedId; article.Title = expectedTitle; article.Body = expectedBody; article.Timestamp = expectedTimestamp; await this.articlesRepository.AddAsync(article); var role1 = new ApplicationRole("role1"); var identityResult = await this.roleManager.CreateAsync(role1); Assert.True(identityResult.Succeeded); var role2 = new ApplicationRole("role2"); identityResult = await this.roleManager.CreateAsync(role2); Assert.True(identityResult.Succeeded); var articleRole1 = new ArticleRole(); articleRole1.Article = article; articleRole1.Role = role1; await this.articleRolesRepository.AddAsync(articleRole1); var articleRole2 = new ArticleRole(); articleRole2.Article = article; articleRole2.Role = role2; await this.articleRolesRepository.AddAsync(articleRole2); var actual = await this.articlesRetriever.GetArticleWithRolesAsync(article.Id); Assert.Equal(expectedId, actual.Id); Assert.Equal(expectedTitle, actual.Title); Assert.Equal(expectedBody, actual.Body); Assert.Equal(expectedTimestamp, actual.Timestamp); Assert.True("role1, role2" == actual.Roles || "role2, role1" == actual.Roles); }
private async Task UpdateArticleRoles(Article article, string[] roles) { await this.articleRolesRepository.DeleteAllForArticleAsync(article.Id); if (roles != null) { foreach (var role in roles) { var applicationRole = await this.roleManager.FindByNameAsync(role); var articleRole = new ArticleRole(); articleRole.Article = article; articleRole.Role = applicationRole; await this.articleRolesRepository.AddAsync(articleRole); } } }
public static ArticleParametr CreateRefer(string name, FieldType type, ArticleRole refer) { return(new ArticleParametr(name, type, refer)); }
public ArticleParametr(string name, FieldType type, ArticleRole refer) { Name = name; Type = type; Refer = refer; }
public ArticleParametr(string name, FieldType type) { Name = name; Type = type; Refer = ArticleRole.ARTICLE_UNKNOWN; }
public ClassMethodBlok(ArticleRole code, string name) : base() { ClassCode = code; ClassName = name; FullClassName = name + NAME_METHODS_POSTFIX; }
public ClassMethodBlok(SourceBlokBase parent, ArticleRole code, string name) : base(parent) { ClassCode = code; ClassName = name; FullClassName = name + NAME_METHODS_POSTFIX; }
public ClassDefinitionBlok(ArticleRole code, string name) : base() { ClassCode = code; ClassName = name; }
public ClassDefinitionBlok(SourceBlokBase parent, ArticleRole code, string name) : base(parent) { ClassCode = code; ClassName = name; }