public async Task <IActionResult> Post([FromBody] CustomBillViewModel bill)
        {
            if (ModelState.IsValid)
            {
                var newcBill = Mapper.Map <CustomBill>(bill);
                _repository.AddCustomBill(newcBill);

                if (await _repository.SaveChangesAsync())
                {
                    return(Created($"api/custombills/{newcBill.Id}", Mapper.Map <CustomBillViewModel>(newcBill)));
                }
            }
            return(BadRequest("Failed to save the bill"));
        }
        public async Task <IActionResult> Post([FromBody] BillViewModel bill)
        {
            if (ModelState.IsValid)
            {
                var newBill = Mapper.Map <Bill>(bill);
                newBill.UserId          = new Guid(_userManager.GetUserId(HttpContext.User));
                newBill.BackgroundColor = "#000000";
                newBill.ForeColor       = "#00ff00";
                newBill.Icon            = "fa fa-asterisk";
                _repository.AddBill(newBill);

                if (await _repository.SaveChangesAsync())
                {
                    return(Created($"api/bills/{newBill.Id}", Mapper.Map <BillViewModel>(newBill)));
                }
            }
            return(BadRequest("Failed to save the bill"));
        }
        public async Task <IActionResult> Put([FromBody] SettingsViewModel settings)
        {
            if (ModelState.IsValid)
            {
                var thisSetting = Mapper.Map <Setting>(settings);
                thisSetting.UserID = new Guid(_userManager.GetUserId(HttpContext.User));
                _repository.UpdateSettings(thisSetting);

                if (await _repository.SaveChangesAsync())
                {
                    return(Created($"api/settings/{thisSetting.UserID}", Mapper.Map <SettingsViewModel>(thisSetting)));
                }
            }
            return(BadRequest("Failed to save the Settings"));
        }