Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ The delimeter between each part of a path. E.g. "Person.Address.Line1". Default:
Specifies if attribute tags like [XmlIgnore] or [XmlElement(Name="value")] should be observed. Default: true (bool)

### UseJsonAttributes
Specifies if attribute tags like [JsonIgnore] or [JsonProperty("value")] should be observed. Default: true (bool)
Specifies if attribute tags like [JsonIgnore] or [JsonProperty("value")] or [JsonRequired] should be observed. Default: true (bool)

### UseSerializerAttributes
Specifies if attribute tags like [NonSerialized] or [DataMember(Name="value")]. Default: true (bool)
Specifies if attribute tags like [NonSerialized] or [DataMember(Name="value")] should be observed. Default: true (bool)

### UseDataAnnotationAttributes
Specifies if attribute tags like [StringLength] should be observed. Default: true (bool)


### ConvertChildCollectionsToRows
Indicates if a collection is detected as a property on the object to be serialized, the collection will be converted to rows.
Expand Down
17 changes: 17 additions & 0 deletions src/CsvSerializer/CsvSerializationException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace CsvSerializer
{
public class CsvSerializationException : Exception
{
public CsvSerializationException(string message) : base(message)
{
}

public CsvSerializationException(string message, Exception innerException) : base(message, innerException)
{
}
}
}
4 changes: 3 additions & 1 deletion src/CsvSerializer/CsvSerializer.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
<TargetFramework>netstandard1.4</TargetFramework>
<AssemblyName>CsvSerializer</AssemblyName>
<PackageId>CsvSerializer</PackageId>
<NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
Expand Down Expand Up @@ -31,6 +31,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NETCore.Portable.Compatibility" Version="1.0.1" />
<PackageReference Include="NewtonSoft.Json" Version="13.0.1" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
</ItemGroup>

Expand Down
4 changes: 4 additions & 0 deletions src/CsvSerializer/CsvSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public class CsvSettings
/// <summary>Specifies if attribute tags like [NonSerialized] or [DataMember(Name="value")]</summary>
public bool UseSerializerAttributes { get; set; }

/// <summary>Specifies if attribute tags like [StringLength]</summary>
public bool UserDataAnnotationAttributes { get; set; }

/// <summary>
/// Indicates if a collection is detected as a property on the object to be serialized, the collection will be converted to rows.
/// E.g. If there is a Person with 3 addresses, there will be columns for Person.Address1.City, Person.Address2.City, and Person.Address3.City.
Expand Down Expand Up @@ -73,6 +76,7 @@ public CsvSettings()
UseXmlAttributes = true;
UseJsonAttributes = true;
UseSerializerAttributes = true;
UserDataAnnotationAttributes = true;
ConvertChildCollectionsToRows = true;
FlattenHeirarchicalStructuresWithEmptyRows = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/CsvSerializer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Mindfire Technology")]
[assembly: AssemblyProduct("CsvSerializer")]
[assembly: AssemblyCopyright("Copyright © Mindfite Technology")]
[assembly: AssemblyCopyright("Copyright © Mindfire Technology")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
Expand Down
Loading