Example #1
0
 public static AttributeCategory ToDataModel(this Contracts.AttributeCategory.CreateAttributeCategory create)
 {
     return(new AttributeCategory
     {
         Name = create.Name,
         Description = create.Description,
         AttributeTypeId = create.AttributeTypeId,
         CreatedOn = DateTime.Now,
         UpdatedOn = DateTime.Now,
     });
 }
Example #2
0
        public Contracts.AttributeCategory.AttributeCategory Create(Contracts.AttributeCategory.CreateAttributeCategory create)
        {
            using (var db = new RAAPEntities(GetConnectionString()))
            {
                var category = create.ToDataModel();
                db.AttributeCategories.Add(category);
                db.SaveChanges();

                return(category.ToContract());
            }
        }
Example #3
0
 public IHttpActionResult Post([FromBody] Contracts.AttributeCategory.CreateAttributeCategory create)
 {
     AttributeCategoryService.Create(create);
     return(Ok());
 }