public Community ProvisionPhones(Community community) { Community book = community; if (book.Book == null && book.Id.HasValue) { Community byId = CommunityBc.Instance.GetById(book.Id.Value); book.Book = byId.Book; if (book.Address == null || book.Address.Country == null || !book.Address.Country.Id.HasValue) { book.Address = byId.Address; } } List <Publication> books = AccountBc.Instance.GetBooks(); if (books.Any <Publication>((Publication b) => { long id = (long)b.Id; long?nullable = book.Book.Id; return(id == nullable.GetValueOrDefault() & nullable.HasValue); })) { book.Book.Number = books.First <Publication>((Publication b) => { long id = (long)b.Id; long?nullable = book.Book.Id; return(id == nullable.GetValueOrDefault() & nullable.HasValue); }).Name; } book = MarchexBc.ProvisionPhones(book); return(book); }
public ServiceProvider ProvisionPhones(ServiceProvider serviceProvider) { ServiceProvider book = serviceProvider; if (book.Book == null && book.Id.HasValue) { ServiceProvider byId = ServiceProviderBc.Instance.GetById(book.Id.Value); book.Book = byId.Book; if (book.Address == null || book.Address.Country == null || !book.Address.Country.Id.HasValue) { book.Address = byId.Address; } } List <Publication> books = AccountBc.Instance.GetBooks(); if (books.Any <Publication>((Publication b) => { long id = (long)b.Id; long?nullable = book.Book.Id; return(id == nullable.GetValueOrDefault() & nullable.HasValue); })) { book.Book.Number = books.First <Publication>((Publication b) => { long id = (long)b.Id; long?nullable = book.Book.Id; return(id == nullable.GetValueOrDefault() & nullable.HasValue); }).Name; } book = MarchexBc.ProvisionPhones(book); return(book); }