public async Task <SystemWebsiteModel> Validate(SystemWebsiteModel model) { if (string.IsNullOrEmpty(model.Url)) { throw new WebsiteUrlIsRequiredException(); } model.Type = await _systemLookupItemService.GetItem("Website Types", model.Type.Id); return(model); }
// Create entity from model. public SystemWebsite(SystemWebsiteModel model) { Type = new SystemLookupItemValue(model.Type); Url = model.Url; }