当前位置: 首页>>代码示例>>C#>>正文


C# UnitOfWork.commit方法代码示例

本文整理汇总了C#中UnitOfWork.commit方法的典型用法代码示例。如果您正苦于以下问题:C# UnitOfWork.commit方法的具体用法?C# UnitOfWork.commit怎么用?C# UnitOfWork.commit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnitOfWork的用法示例。


在下文中一共展示了UnitOfWork.commit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Add

 public int Add(ref Mugurtham.Core.Profile.Photo.PhotoCoreEntity objPhotoCoreEntity)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         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;
 }
开发者ID:AnandJS,项目名称:Mugurtham,代码行数:25,代码来源:PhotoCore.cs

示例2: Add

 public int Add(ref Mugurtham.Core.Sangam.SangamCoreEntity objSangamCoreEntity, out string strSangamID)
 {
     strSangamID = Helpers.primaryKey;
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Sangam.Sangam objDTOSangam = new DTO.Sangam.Sangam();
             using (objDTOSangam as IDisposable)
             {
                 objSangamCoreEntity.ID = strSangamID;
                 objSangamCoreEntity.RunningNoStartsFrom = 1000;
                 objSangamCoreEntity.LastProfileIDNo = 1000;
                 AssignDTOFromEntity(ref objDTOSangam, ref objSangamCoreEntity);
             }
             objIUnitOfWork.RepositorySangam.Add(objDTOSangam);
             objDTOSangam = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
开发者ID:AnandJS,项目名称:Mugurtham,代码行数:28,代码来源:SangamCore.cs

示例3: Add

 public int Add(ref Mugurtham.Core.Role.RoleCoreEntity objRoleCoreEntity, out string strRoleID)
 {
     strRoleID = Helpers.primaryKey;
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Role.Role objDTORole = new DTO.Role.Role();
             using (objDTORole as IDisposable)
             {
                 objRoleCoreEntity.ID = strRoleID;
                 AssignDTOFromEntity(ref objDTORole, ref objRoleCoreEntity);
             }
             objIUnitOfWork.RepositoryRole.Add(objDTORole);
             objDTORole = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
开发者ID:AnandJS,项目名称:Mugurtham,代码行数:26,代码来源:RoleCore.cs

示例4: Add

 public int Add(ref Mugurtham.Core.User.UserCoreEntity objUserCoreEntity, out string strUserID)
 {
     strUserID = Helpers.primaryKey;
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.User.User objDTOUser = new DTO.User.User();
             using (objDTOUser as IDisposable)
             {
                 objUserCoreEntity.ID = strUserID;
                 assignHomePagePath(ref objUserCoreEntity);
                 AssignDTOFromEntity(ref objDTOUser, ref objUserCoreEntity);
             }
             objIUnitOfWork.RepositoryUser.Add(objDTOUser);
             objDTOUser = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
开发者ID:AnandJS,项目名称:Mugurtham,代码行数:27,代码来源:UserCore.cs

示例5: Add

 public int Add(string ProfileID)
 {
     int status = -1;
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Profile.Horoscope objDTOHoroscope = new DTO.Profile.Horoscope();
             using (objDTOHoroscope as IDisposable)
             {
                 objDTOHoroscope.ProfileID = ProfileID;
             }
             objIUnitOfWork.RepositoryHoroscope.Add(objDTOHoroscope);
             objIUnitOfWork.commit();
             objDTOHoroscope = null;
         }
         objIUnitOfWork = null;
         status = 0;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
         status = -1;
     }
     return status;
 }
开发者ID:AnandJS,项目名称:Mugurtham,代码行数:27,代码来源:HoroscopeCore.cs

示例6: Delete

 public int Delete(string strID)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Profile.Photo objPhoto = new DTO.Profile.Photo();
             using (objPhoto as IDisposable)
                 objPhoto = objIUnitOfWork.RepositoryPhoto.GetAll().ToList().Where(p => p.ID == strID).FirstOrDefault();
             if (objPhoto != null)
             {
                 IUnitOfWork objIUnitOfWorkDeletePic = new UnitOfWork();
                 using (objIUnitOfWorkDeletePic as IDisposable)
                 {
                     objIUnitOfWorkDeletePic.RepositoryPhoto.Delete(objPhoto);
                     objIUnitOfWorkDeletePic.commit();
                 }
                 objIUnitOfWorkDeletePic = null;
             }
         }
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
开发者ID:AnandJS,项目名称:Mugurtham,代码行数:29,代码来源:PhotoCore.cs

示例7: Add

 public int Add(ref Mugurtham.Core.ProfileViewed.ProfileViewedCoreEntity objProfileViewedCoreEntity)
 {
     try
     {
         string strMappingID = string.Empty;
         string strViewerID = objProfileViewedCoreEntity.ViewerID;
         string strViewedID = objProfileViewedCoreEntity.ViewedID;
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.ProfileViewed.ProfileViewed objDTOProfileViewed = new DTO.ProfileViewed.ProfileViewed();
             using (objDTOProfileViewed as IDisposable)
             {
                 objDTOProfileViewed.ID = Helpers.primaryKey;
                 objDTOProfileViewed.ViewerID = objProfileViewedCoreEntity.ViewerID;
                 objDTOProfileViewed.ViewedID = objProfileViewedCoreEntity.ViewedID;
             }
             List<Mugurtham.DTO.ProfileViewed.ProfileViewed> objProfileViewed = new List<DTO.ProfileViewed.ProfileViewed>();
             using (objProfileViewed as IDisposable)
             {
                 objProfileViewed = objIUnitOfWork.RepositoryProfileViewed.GetAll().ToList().
                 Where(p => p.ViewerID.Trim().ToLower() == strViewerID.Trim().ToLower() &&
                       p.ViewedID.Trim().ToLower() == strViewedID.Trim().ToLower()).ToList();
                 foreach (DTO.ProfileViewed.ProfileViewed objProfiles in objProfileViewed)
                 {
                     strMappingID = objProfiles.ID;
                 }
             }
             if (objProfileViewed.Count == 0)
             {
                 IUnitOfWork objIUnitOfWorkAdd = new UnitOfWork();
                 using (objIUnitOfWorkAdd as IDisposable)
                 {
                     objIUnitOfWorkAdd.RepositoryProfileViewed.Add(objDTOProfileViewed);
                     objIUnitOfWorkAdd.commit();
                     objDTOProfileViewed = null;
                 }
                 objIUnitOfWorkAdd = null;
             }
         }
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
开发者ID:AnandJS,项目名称:Mugurtham,代码行数:48,代码来源:ProfileViewedCore.cs

示例8: getProfilePhotos

 public int getProfilePhotos(string strProfileID, out IQueryable<DTO.Profile.Photo> objDTOPhotoList)
 {
     objDTOPhotoList = null;
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
             objDTOPhotoList = objIUnitOfWork.RepositoryPhoto.getProfilePhotos(strProfileID);
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
开发者ID:AnandJS,项目名称:Mugurtham,代码行数:17,代码来源:PhotoCore.cs

示例9: Add

 public int Add(ref Mugurtham.Core.BasicInfo.BasicInfoCoreEntity objBasicInfoCoreEntity, string LoggedInUserID)
 {
     try
     {
         bool GrantAddAccess = false;
         //One & Only Sangam Admin can add New Profiles.
         //So validate if the user is in SangamAdmin Role and the proceed
         Profile.ProfileSecurity objProfileSecurity = new Profile.ProfileSecurity();
         using (objProfileSecurity as IDisposable)
         {
             if (objProfileSecurity.IsSangamAdmin(LoggedInUserID))
             {
                 GrantAddAccess = true;
             }
             objProfileSecurity = null;
         }
         if (GrantAddAccess)
         {
             IUnitOfWork objIUnitOfWork = new UnitOfWork();
             using (objIUnitOfWork as IDisposable)
             {
                 Mugurtham.DTO.Profile.BasicInfo objDTOBasicInfo = new DTO.Profile.BasicInfo();
                 using (objDTOBasicInfo as IDisposable)
                 {
                     AssignDTOFromEntity(ref objDTOBasicInfo, ref objBasicInfoCoreEntity);
                     objDTOBasicInfo.CreatedDate = DateTime.Now;
                 }
                 objIUnitOfWork.RepositoryBasicInfo.Add(objDTOBasicInfo);
                 objDTOBasicInfo = null;
             }
             objIUnitOfWork.commit();
             objIUnitOfWork = null;
             return 0;
         }
         else
         {
             return -1;
         }
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
开发者ID:AnandJS,项目名称:Mugurtham,代码行数:45,代码来源:BasicInfoCore.cs

示例10: Add

 public int Add(ref Mugurtham.Core.Raasi.RaasiCoreEntity objRaasiCoreEntity)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Profile.Raasi objDTORaasi = new DTO.Profile.Raasi();
             using (objDTORaasi as IDisposable)
             {
                 AssignDTOFromEntity(ref objDTORaasi, ref objRaasiCoreEntity);
             }
             objIUnitOfWork.RepositoryRaasi.Add(objDTORaasi);
             objDTORaasi = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
开发者ID:AnandJS,项目名称:Mugurtham,代码行数:24,代码来源:RaasiCore.cs

示例11: Edit

 public int Edit(ref Mugurtham.Core.Contact.ContactCoreEntity objContactCoreEntity)
 {
     IUnitOfWork objIUnitOfWork = new UnitOfWork();
     try
     {
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Profile.Contact objDTOContact = new DTO.Profile.Contact();
             using (objDTOContact as IDisposable)
             {
                 AssignDTOFromEntity(ref objDTOContact, ref objContactCoreEntity);
             }
             objIUnitOfWork.RepositoryContact.Edit(objDTOContact);
             objDTOContact = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
开发者ID:AnandJS,项目名称:Mugurtham,代码行数:24,代码来源:ContactCore.cs

示例12: Edit

 public int Edit(ref Mugurtham.Core.Location.LocationCoreEntity objLocationCoreEntity)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Profile.Location objDTOLocation = new DTO.Profile.Location();
             using (objDTOLocation as IDisposable)
             {
                 AssignDTOFromEntity(ref objDTOLocation, ref objLocationCoreEntity);
             }
             objIUnitOfWork.RepositoryLocation.Edit(objDTOLocation);
             objDTOLocation = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
开发者ID:AnandJS,项目名称:Mugurtham,代码行数:24,代码来源:LocationCore.cs

示例13: Add

 public int Add(ref Mugurtham.Core.Family.FamilyCoreEntity objFamilyCoreEntity)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Profile.Family objDTOFamily = new DTO.Profile.Family();
             using (objDTOFamily as IDisposable)
             {
                 AssignDTOFromEntity(ref objDTOFamily, ref objFamilyCoreEntity);
             }
             objIUnitOfWork.RepositoryFamily.Add(objDTOFamily);
             objDTOFamily = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
开发者ID:AnandJS,项目名称:Mugurtham,代码行数:24,代码来源:FamilyCore.cs

示例14: Edit

 public int Edit(ref Mugurtham.Core.Career.CareerCoreEntity objCareerCoreEntity)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Profile.Career objDTOCareer = new DTO.Profile.Career();
             using (objDTOCareer as IDisposable)
             {
                 AssignDTOFromEntity(ref objDTOCareer, ref objCareerCoreEntity);
             }
             objIUnitOfWork.RepositoryCareer.Edit(objDTOCareer);
             objDTOCareer = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
开发者ID:AnandJS,项目名称:Mugurtham,代码行数:24,代码来源:CareerCore.cs

示例15: Edit

 public int Edit(ref Mugurtham.Core.Role.RoleCoreEntity objRoleCoreEntity)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             Mugurtham.DTO.Role.Role objDTORole = new DTO.Role.Role();
             using (objDTORole as IDisposable)
             {
                 AssignDTOFromEntity(ref objDTORole, ref objRoleCoreEntity);
             }
             objIUnitOfWork.RepositoryRole.Edit(objDTORole);
             objDTORole = null;
         }
         objIUnitOfWork.commit();
         objIUnitOfWork = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
开发者ID:AnandJS,项目名称:Mugurtham,代码行数:24,代码来源:RoleCore.cs


注:本文中的UnitOfWork.commit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。