Example #1
0
 /// <summary>
 ///     Creates a copy of the row.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="mode">The auto updater mode.</param>
 /// <returns>
 ///     Returns a <see cref="IRow" /> representings a duplicate copy of the row.
 /// </returns>
 public static IRow Clone(this IRow source, mmAutoUpdaterMode mode)
 {
     using (new AutoUpdaterModeReverter(mode))
     {
         return(source.Clone());
     }
 }
        private void SaveDetail(IUnitOfWork uow, IRow detail, object masterId, object detailId)
        {
            detail = detail.Clone();

            foreignKeyField.AsObject(detail, masterId);
            if (filterField is object)
            {
                filterField.AsObject(detail, filterValue);
            }

            detail.IdField.AsObject(detail, detailId);

            var saveHandler = handlerFactory.CreateHandler <ISaveRequestProcessor>(rowType);
            var saveRequest = saveHandler.CreateRequest();

            saveRequest.Entity = detail;
            saveHandler.Process(uow, saveRequest, detailId == null ? SaveRequestType.Create : SaveRequestType.Update);
        }
Example #3
0
 /// <summary>
 ///     Creates a new row by duplicating the contents of the specified row.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <returns>
 ///     Returns a <see cref="IRow" /> representings a duplicate copy of the row.
 /// </returns>
 public static IRow Clone(this IRow source)
 {
     return(source.Clone(true));
 }