Skip to content

elky84/JsonTable

Repository files navigation

Website Made with Made with

Publish Nuget Github Package Publish Nuget Package

GitHub forks GitHub stars GitHub watchers GitHub followers

GitHub GitHub repo size in bytes GitHub code size in bytes

JsonTable

introduce

Easily usable Json to Table (dictionary and mores).

Use Newtonsoft.json.

usage

definition

[Table(@"json")]
public partial class TableItem : BaseDict<string, Item>
{
}

load

MasterTable.Load("ItemGenerator.Table");

use

var data = MasterTable.From<TableItem>();
MasterTable.From<TableItem>().FirstOrDefault(x => x.Id == id);

Support Types

  • BaseList
    • List<T>
  • BaseDict
    • Dictionary<K, T>
  • BaseMultiDict
    • Dictionary<K, List<T>>
    • Similar C++ stl Multimap
      • Example
      [Table(@"json")]
      public partial class TableItemByType : BaseMultiDict<ItemType, Item>
      {
          public TableItemByType() : base("Type") // input key property name
          {
          }
      }

Reference

Cli

Version History

v1.0.14

Modified the Load function interface behavior to allow loading from multiple assemblies.

v1.0.13

Remove nullable return of MasterTable and return an exception when requesting an invalid type.

v1.0.12

Added Json load optional method. (virtual interface, for Unity3D)

v1.0.11

Added Container methods (get internal container)

v1.0.10

Added Clone methods

v1.0.9

TargetFramework to netstandard2.1

v1.0.8

Fixed Nullable rule.

v1.0.7

Load from Binary path. (Full Path)

v1.0.6

Exception process reinforcement.

v1.0.5

Features added MultiDict. (like c++ stl multimap)

v1.0.4

Supports OnLoad() function to set configuration rules when container is loaded.

v1.0.3

Tables now only require a folder path. (The full path is not required.)

v1.0.1

removed nullable property on container (BaseDict and BaseList).