This commit is contained in:
2018-10-04 19:26:39 +00:00
parent 1c0400ca9f
commit 707e24291b
2 changed files with 27 additions and 42 deletions

View File

@@ -23,17 +23,29 @@ namespace AyaNova.Biz
public bool V7ValidationImportMode { get; set; }
internal TagGroupBiz(AyContext dbcontext, long currentUserId, AuthorizationRoles userRoles)
internal TagGroupBiz(AyContext dbcontext, long currentUserId, long userLocaleId, AuthorizationRoles userRoles)
{
ct = dbcontext;
UserId = currentUserId;
UserLocaleId = userLocaleId;
CurrentUserRoles = userRoles;
BizType=AyaType.TagGroup;
BizType = AyaType.TagGroup;
V7ValidationImportMode = false;//default
}
internal static TagGroupBiz GetBiz(AyContext ct, Microsoft.AspNetCore.Http.HttpContext httpContext)
{
return new TagGroupBiz(ct, UserIdFromContext.Id(httpContext.Items), UserLocaleIdFromContext.Id(httpContext.Items), UserRolesFromContext.Roles(httpContext.Items));
}
////////////////////////////////////////////////////////////////////////////////////////////////
//EXISTS
internal async Task<bool> ExistsAsync(long id)
{
return await ct.TagGroup.AnyAsync(e => e.Id == id);
}
////////////////////////////////////////////////////////////////////////////////////////////////
//CREATE
@@ -238,6 +250,9 @@ namespace AyaNova.Biz
}
await ct.SaveChangesAsync();
//BIZLOG: Not going to log this for now, it's too common an operation and would require bringing in more info. If decide to implement should log the parent object with text of tag instead
//and don't forget about import from v7 as well
return ReturnObject;
}