Skip to content

Commit

Permalink
Resolved #1057: Should only set 'CanWrite' properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
hikalkan committed Jun 3, 2016
1 parent ddd44be commit d7bab3b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
34 changes: 17 additions & 17 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
version: 1.0.{build}
before_build:
- cmd: dotnet.exe restore
build:
verbosity: minimal
test:
assemblies:
- test\Abp.AutoMapper.Tests\bin\Debug\net452\win7-x64\Abp.AutoMapper.dll
- test\Abp.EntityFramework.Tests\bin\Debug\net452\win7-x64\Abp.EntityFramework.Tests.dll
- test\Abp.MemoryDb.Tests\bin\Debug\net452\win7-x64\Abp.MemoryDb.Tests.dll
- test\Abp.NHibernate.Tests\bin\Debug\net452\win7-x64\Abp.NHibernate.Tests.dll
- test\Abp.RedisCache.Tests\bin\Debug\net452\win7-x64\Abp.RedisCache.Tests.dll
- test\Abp.TestBase.SampleApplication.Tests\bin\Debug\net452\win7-x64\Abp.TestBase.SampleApplication.Tests.dll
- test\Abp.TestBase.Tests\bin\Debug\net452\win7-x64\Abp.TestBase.Tests.dll
- test\Abp.Tests\bin\Debug\net452\win7-x64\Abp.Tests.dll
- test\Abp.Web.Api.Tests\bin\Debug\net452\win7-x64\Abp.Web.Api.Tests.dll
- test\Abp.Web.Mvc.Tests\bin\Debug\net452\win7-x64\Abp.Web.Mvc.Tests.dll
version: 1.0.{build}
before_build:
- cmd: dotnet.exe restore
build:
verbosity: minimal
test:
assemblies:
- test\Abp.AutoMapper.Tests\bin\Debug\net452\win7-x64\Abp.AutoMapper.dll
- test\Abp.EntityFramework.Tests\bin\Debug\net452\win7-x64\Abp.EntityFramework.Tests.dll
- test\Abp.MemoryDb.Tests\bin\Debug\net452\win7-x64\Abp.MemoryDb.Tests.dll
- test\Abp.NHibernate.Tests\bin\Debug\net452\win7-x64\Abp.NHibernate.Tests.dll
- test\Abp.RedisCache.Tests\bin\Debug\net452\win7-x64\Abp.RedisCache.Tests.dll
- test\Abp.TestBase.SampleApplication.Tests\bin\Debug\net452\win7-x64\Abp.TestBase.SampleApplication.Tests.dll
- test\Abp.TestBase.Tests\bin\Debug\net452\win7-x64\Abp.TestBase.Tests.dll
- test\Abp.Tests\bin\Debug\net452\win7-x64\Abp.Tests.dll
- test\Abp.Web.Api.Tests\bin\Debug\net452\win7-x64\Abp.Web.Api.Tests.dll
- test\Abp.Web.Mvc.Tests\bin\Debug\net452\win7-x64\Abp.Web.Mvc.Tests.dll
- test\Abp.Web.Tests\bin\Debug\net452\win7-x64\Abp.Web.Tests.dll
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ private static EntityDateTimePropertiesInfo FindDatePropertyInfosForType(Type en
{
var datetimeProperties = entityType.GetProperties()
.Where(property =>
property.PropertyType == typeof(DateTime) ||
property.PropertyType == typeof(DateTime?)
(property.PropertyType == typeof(DateTime) ||
property.PropertyType == typeof(DateTime?)) &&
property.CanWrite
).ToList();

var complexTypeProperties = entityType.GetProperties()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public void GetDatePropertyInfos_Test()
{
var dateTimePropertInfos = DateTimePropertyInfoHelper.GetDatePropertyInfos(typeof(Hotel));

dateTimePropertInfos.DateTimePropertyInfos.Count.ShouldBe(2);
dateTimePropertInfos.DateTimePropertyInfos.Count.ShouldBe(1);
dateTimePropertInfos.ComplexTypePropertyPaths.Count.ShouldBe(6);

dateTimePropertInfos.ComplexTypePropertyPaths.Count(path => path.Contains("RealLocation")).ShouldBe(3);
Expand All @@ -26,7 +26,8 @@ public class Hotel
{
public string Name { get; set; }

public DateTime CreationDate { get; set; }
public DateTime CreationDate { get { return _creationDate; } }
private DateTime _creationDate;

public DateTime? ModificationDate { get; set; }

Expand Down

0 comments on commit d7bab3b

Please sign in to comment.