/// <summary> /// Saves the suburb. /// </summary> /// <param name="suburb">The suburb.</param> /// <returns></returns> public async Task <int> SaveSuburb(EntitySuburb suburb) { suburb.Id = UtilsService.GenerateId(suburb.Id); return(await Util.TryAsync(() => GetConnection().InsertOrReplaceAsync(suburb), failureMessage : "DataContext failed to SAVE EntitySuburb")); }
/// <summary> /// To the model. /// </summary> /// <param name="entity">The entity.</param> /// <returns></returns> internal static ModelSuburb ToModel(this EntitySuburb entity) { var model = new ModelSuburb(); model.Id = entity.Id; model.TownId = entity.TownId; model.Name = entity.Name; return(model); }