Exemplo n.º 1
0
        public IHttpActionResult CreateCategory(LogCategoryDTO logCategoryDTO)
        {
            if (!ModelState.IsValid)
            {
                throw new HttpResponseException(System.Net.HttpStatusCode.BadRequest);
            }

            var category = Mapper.Map <LogCategoryDTO, LogCategory>(logCategoryDTO);

            category.ApplicationUserId = User.Identity.GetUserId();



            //category = context.LogCategories.Add(category);

            unitOfWork.LogCategories.Insert(category);

            unitOfWork.Commit();

            return(Ok(Mapper.Map <LogCategory, LogCategoryDTO>(category)));
        }
Exemplo n.º 2
0
 public IHttpActionResult UpdateCategory(LogCategoryDTO logCategoryDTO)
 {
     return(NotFound());
 }