Ejemplo n.º 1
0
        public IHttpActionResult InsertResource([FromBody] ResourceModel modelToInsert)
        {
            bool isInserted = ResourceManager.InsertResource(ResourceModel.MapEntities(modelToInsert));

            if (isInserted)
            {
                return(Ok());
            }
            return(BadRequest($"Cannot insert Resource,  ID: {modelToInsert.ID}. Check if ID already Exists"));
        }
Ejemplo n.º 2
0
        public IHttpActionResult UpdateResource([FromBody] ResourceModel model)
        {
            bool isModified = ResourceManager.UpdateResource(ResourceModel.MapEntities(model));

            if (isModified)
            {
                return(Ok());
            }
            return(BadRequest($"Cannot update Resource, ID: {model.ID}. Check parameters"));
        }