public int Add(ref Mugurtham.Core.Profile.Photo.PhotoCoreEntity objPhotoCoreEntity) { try { IUnitOfWork objIUnitOfWork = new UnitOfWork(_objLoggedInUser.ConnectionStringAppKey); using (objIUnitOfWork as IDisposable) { Mugurtham.DTO.Profile.Photo objDTOPhoto = new DTO.Profile.Photo(); using (objDTOPhoto as IDisposable) { objDTOPhoto.ID = Helpers.primaryKey; AssignDTOFromEntity(ref objDTOPhoto, ref objPhotoCoreEntity); } objIUnitOfWork.RepositoryPhoto.Add(objDTOPhoto); objDTOPhoto = null; } objIUnitOfWork.commit(); objIUnitOfWork = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return(0); }
private int AssignDTOFromEntity(ref Mugurtham.DTO.Profile.Photo objPhoto, ref Mugurtham.Core.Profile.Photo.PhotoCoreEntity objPhotoCoreEntity) { try { objPhoto.ProfileID = objPhotoCoreEntity.ProfileID; objPhoto.PhotoPath = objPhotoCoreEntity.PhotoPath; objPhoto.IsProfilePic = objPhotoCoreEntity.IsProfilePic; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return(0); }