public static bool IsExisting(this PhoneData payload, PhoneContext IdContext) { var validatedNumber = IdContext.Phones.FirstOrDefault(x => x.DDD == payload.DDD && x.PhoneNumber == payload.PhoneNumber); if (validatedNumber != null) { return(true); } return(false); }
public static bool SaveNumber(this PhoneData payload, PhoneContext IdContext) { IdContext.Phones.Add(payload); return(true); }