public object GetService(Type serviceType)
{
if (serviceType.IsGenericType)
{
Type definition = serviceType.GetGenericTypeDefinition();
if (definition == typeof(IEntityContext<>) || definition == typeof(IEntityQueryable<>))
return _Builder.GetContext(serviceType.GetGenericArguments()[0]);
else
return null;
}
else
{
if (typeof(IEntity).IsAssignableFrom(serviceType))
return _Builder.GetContext(serviceType);
else
return null;
}
}