/// <summary>Updates the specified SD.HnD.DALAdapter.EntityClasses.IPBanEntity entity with the values stored in the dto object specified</summary> /// <param name="toUpdate">the entity instance to update.</param> /// <param name="dto">The dto object containing the source values.</param> /// <remarks>The PK field of toUpdate is set only if it's not marked as readonly.</remarks> public static void UpdateFromIPBan(this SD.HnD.DALAdapter.EntityClasses.IPBanEntity toUpdate, SD.HnD.DTOs.DtoClasses.IPBanDto dto) { if ((toUpdate == null) || (dto == null)) { return; } toUpdate.IPBanSetByUserID = dto.IPBanSetByUserID; toUpdate.IPBanSetOn = dto.IPBanSetOn; toUpdate.IPSegment1 = dto.IPSegment1; toUpdate.IPSegment2 = dto.IPSegment2; toUpdate.IPSegment3 = dto.IPSegment3; toUpdate.IPSegment4 = dto.IPSegment4; toUpdate.Range = dto.Range; toUpdate.Reason = dto.Reason; }
/// <summary>Creates a primary key predicate to be used in a Where() clause in a Linq query which is executed on the database to fetch the original entity instance the specified <see cref="dto"/> object was projected from.</summary> /// <param name="dto">The dto object for which the primary key predicate has to be created for.</param> /// <returns>ready to use expression</returns> public static System.Linq.Expressions.Expression <Func <SD.HnD.DALAdapter.EntityClasses.IPBanEntity, bool> > CreatePkPredicate(SD.HnD.DTOs.DtoClasses.IPBanDto dto) { return(p__0 => p__0.IPBanID == dto.IPBanID); }
/// <summary>Creates a primary key predicate to be used in a Where() clause in a Linq query on an IEnumerable in-memory set of entity instances to retrieve the original entity instance the specified <see cref="dto"/> object was projected from.</summary> /// <param name="dto">The dto object for which the primary key predicate has to be created for.</param> /// <returns>ready to use func</returns> public static Func <SD.HnD.DALAdapter.EntityClasses.IPBanEntity, bool> CreateInMemoryPkPredicate(SD.HnD.DTOs.DtoClasses.IPBanDto dto) { return(p__0 => p__0.IPBanID == dto.IPBanID); }