public static T Fetch <T, TE>(T modelObject, TE dbEntity, ObjectFactoryBase <T, TE> objectFactory, Action <ObjectFactoryBase <T, TE> > actionFetch = null) { objectFactory.ModelObject = modelObject; objectFactory.DbEntity = dbEntity; if (actionFetch != null) { actionFetch(objectFactory); } else { objectFactory.Fetch(); } return(objectFactory.ModelObject); }
private static T GetAndFetch <T, TE>(object id, ObjectFactoryBase <T, TE> objectFactory) { objectFactory.Get(id); objectFactory.Fetch(); return(objectFactory.ModelObject); }