public async Task CreateCategory(string name, Guid userid) { using (var CategoryService = new BlogCagetoryService()) { await CategoryService.CreateAsync(new BlogCagetory() { UserId = userid, Cagetory = name }); } }
public async Task <List <BlogCagetoryDto> > GetAllCagetory(Guid userId) { using (IBlogCagetory cagetoryService = new BlogCagetoryService()) { return(await cagetoryService.GetAll().Select(m => new BlogCagetoryDto() { Id = m.Id, CagetoryName = m.Cagetory }).ToListAsync()); } }