mirror of
https://github.com/DevExpress/netcore-winforms-demos.git
synced 2025-12-28 12:29:46 +00:00
19.1.3-ctp
This commit is contained in:
committed by
GitHub
parent
2e45b5d38f
commit
a2371dfb0b
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Runtime.Serialization;
|
||||
using DevExpress.Common;
|
||||
|
||||
namespace DevExpress.DevAV {
|
||||
public abstract class DatabaseObject : IDataErrorInfo {
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
#region IDataErrorInfo
|
||||
string IDataErrorInfo.Error { get { return null; } }
|
||||
string IDataErrorInfo.this[string columnName] {
|
||||
get { return IDataErrorInfoHelper.GetErrorText(this, columnName); }
|
||||
}
|
||||
#endregion
|
||||
#if DXCORE3
|
||||
protected void SetPropertyValue<T>(string sourcePropertyName, string targetPrefix, T source) {
|
||||
string actualTargetName = targetPrefix + sourcePropertyName;
|
||||
var sourceProperty = source.GetType().GetProperty(sourcePropertyName);
|
||||
var targetProperty = GetType().GetProperty(actualTargetName);
|
||||
var sourceValue = sourceProperty.GetValue(source);
|
||||
targetProperty.SetValue(this, sourceValue);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user