private LocationCoreEntity GetByProfileID(string strProfileID) { LocationCoreEntity objLocationCoreEntity = new LocationCoreEntity(); try { Mugurtham.DTO.Profile.Location objLocation = new Mugurtham.DTO.Profile.Location(); IUnitOfWork objUOW = new UnitOfWork(_objLoggedInUser.ConnectionStringAppKey); using (objUOW as IDisposable) objLocation = objUOW.RepositoryLocation.GetAll().ToList().Where(p => p.ProfileID.Trim().ToLower() == strProfileID.Trim().ToLower()).FirstOrDefault(); objUOW = null; if (objLocation != null) { using (objLocation as IDisposable) { AssignEntityFromDTO(ref objLocation, ref objLocationCoreEntity); } } objLocation = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return(objLocationCoreEntity); }
public LocationCoreEntity GetByProfileID(string strProfileID) { LocationCoreEntity objLocationCoreEntity = new LocationCoreEntity(); try { Mugurtham.DTO.Profile.Location objLocation = new Mugurtham.DTO.Profile.Location(); IUnitOfWork objUOW = new UnitOfWork(); using (objUOW as IDisposable) objLocation = objUOW.RepositoryLocation.GetAll().ToList().Where(p => p.ProfileID.Trim().ToLower() == strProfileID.Trim().ToLower()).FirstOrDefault(); objUOW = null; if (objLocation != null) { using (objLocation as IDisposable) { AssignEntityFromDTO(ref objLocation, ref objLocationCoreEntity); } } objLocation = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return objLocationCoreEntity; }
private int AssignEntityFromDTO(ref Mugurtham.DTO.Profile.Location objDTOLocation, ref Mugurtham.Core.Location.LocationCoreEntity objLocationCoreEntity) { try { objLocationCoreEntity.ProfileID = objDTOLocation.ProfileID; objLocationCoreEntity.CitizenShip = objDTOLocation.CitizenShip; objLocationCoreEntity.CountryLivingIn = objDTOLocation.CountryLivingIn; objLocationCoreEntity.ResidentStatus = objDTOLocation.ResidentStatus; objLocationCoreEntity.ResidingCity = objDTOLocation.ResidingCity; objLocationCoreEntity.ResidingState = objDTOLocation.ResidingState; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return(0); }