Ejemplo n.º 1
0
        public IHttpActionResult DeleteDimEmployee(int id)
        {
            DimEmployeeType dimEmployee = employee.Value.Delete(id).MapperPruebasDetached(new DimEmployeeType());

            if (dimEmployee == null)
            {
                return(NotFound());
            }

            return(Ok(dimEmployee));
        }
Ejemplo n.º 2
0
        public IHttpActionResult PutDimEmployee(DimEmployeeType dimEmployee)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            employee.Value.Update(dimEmployee);

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 3
0
        //[ResponseType(typeof(DimEmployeeType))]
        public IHttpActionResult PostDimEmployee(DimEmployeeType dimEmployee)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            dimEmployee = employee.Value.Create(dimEmployee).MapperPruebasDetached(new DimEmployeeType());

            return(CreatedAtRoute("DefaultApi", new { id = dimEmployee.EmployeeKey }, dimEmployee));
        }
Ejemplo n.º 4
0
        public IHttpActionResult GetDimEmployee(int id)
        {
            DimEmployeeType dimEmployee = DimEmployeeId(id);

            if (dimEmployee == null)
            {
                return(NotFound());
            }

            return(Ok(dimEmployee));
        }