/// <summary> /// Persists a new instance of GeoCountry. /// </summary> /// <returns></returns> public async Task <bool> Save(IGeoCountry geoCountry, CancellationToken cancellationToken = default(CancellationToken)) { if (geoCountry == null) { return(false); } cancellationToken.ThrowIfCancellationRequested(); bool result; if (geoCountry.Guid == Guid.Empty) { geoCountry.Guid = Guid.NewGuid(); result = await dbGeoCountry.Create( geoCountry.Guid, geoCountry.Name, geoCountry.ISOCode2, geoCountry.ISOCode3); } else { result = await dbGeoCountry.Update( geoCountry.Guid, geoCountry.Name, geoCountry.ISOCode2, geoCountry.ISOCode3); } return(result); }
/// <summary> /// Persists a new instance of GeoCountry. /// </summary> /// <returns></returns> public async Task <bool> Save(IGeoCountry geoCountry) { if (geoCountry == null) { return(false); } bool result; if (geoCountry.Guid == Guid.Empty) { geoCountry.Guid = Guid.NewGuid(); result = await dbGeoCountry.Create( geoCountry.Guid, geoCountry.Name, geoCountry.ISOCode2, geoCountry.ISOCode3); } else { result = await dbGeoCountry.Update( geoCountry.Guid, geoCountry.Name, geoCountry.ISOCode2, geoCountry.ISOCode3); } return(result); }