Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var type = GetTypeFromAssembly(typeName, fullNameSpaceType);
- var instanceOfMyType = Activator.CreateInstance(type);
- ReadObject(instanceOfMyType.GetType().GetProperties(), instanceOfMyType, fullNameSpaceType);
- return instanceOfMyType;
- var parameter = Expression.Parameter(typeof(TObject));
- var condition =
- Expression.Lambda<Func<TObject, bool>>(
- Expression.Equal(
- Expression.Property(parameter, theEntity.GetType().GetProperty("Id").Name),
- Expression.Constant(id, typeof(TKey))
- ), parameter
- ).Compile();
- var theObject = _unitOfWork.Set<TObject>().Where(condition).FirstOrDefault();
- var theObject = _catalogService.CreateObjectInstance(catalog, "Cms.Spv.Entities");
- _catalogService.GetObjectById<Guid, theObject>(id, theObject);
- var MiObjeto = context.Set<T>().Find(PK);
- public abstract class MiClaseGenerica<T> : IMiClaseGenerica<T> where T : class
- {
- public T ObtenerPorId(long PK)
- {
- return context.Set<T>().Find(PK);
- }
- }
- public interface IMiClaseGenerica<T> : IDisposable where T : class
- {
- T ObtenerPorId(long PK);
- }
- return _unitOfWork.Set<IComun>().Where(x=> x.PropiedadComun==id).FirstOrDefault();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement