Example #1
0
        public async Task <IActionResult> CreateColoc([FromBody] ColocViewModel model)
        {
            int roomieId = int.Parse(HttpContext.User.FindFirst(c => c.Type == ClaimTypes.NameIdentifier).Value);

            var result = await Gateway.Create(roomieId, model.ColocName);

            return(this.CreateResult(result, o =>
            {
                o.RouteName = "GetColoc";
                o.RouteValues = colocId => new { colocId };
            }));
        }
Example #2
0
        public async Task <IActionResult> Update([FromBody] ColocViewModel model)
        {
            Result result = await Gateway.Update(model.ColocId, model.ColocName, model.PicPath);

            return(this.CreateResult(result));
        }