public virtual object GetPrimaryKeyValueForObject(object obj, Type mappingAttributesType) { MappingContext mappingContext = MappingContext.GetMappingContext(obj.GetType(), mappingAttributesType); return(mappingContext.GetPrimaryKeyValueForObject(obj)); }