forked from yavordimitrov/SmartStoreNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExtensions.cs
More file actions
26 lines (25 loc) · 901 Bytes
/
Copy pathExtensions.cs
File metadata and controls
26 lines (25 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
using System.Data.Objects;
using SmartStore.Core;
namespace SmartStore.Data
{
public static class Extensions
{
/// <summary>
/// Get unproxied entity type
/// </summary>
/// <remarks> If your Entity Framework context is proxy-enabled,
/// the runtime will create a proxy instance of your entities,
/// i.e. a dynamically generated class which inherits from your entity class
/// and overrides its virtual properties by inserting specific code useful for example
/// for tracking changes and lazy loading.
/// </remarks>
/// <param name="entity"></param>
/// <returns></returns>
public static Type GetUnproxiedEntityType(this BaseEntity entity)
{
var userType = ObjectContext.GetObjectType(entity.GetType());
return userType;
}
}
}