Skip to content

Instantly share code, notes, and snippets.

@n9
Last active December 16, 2015 18:20
Show Gist options
  • Save n9/5476930 to your computer and use it in GitHub Desktop.
Save n9/5476930 to your computer and use it in GitHub Desktop.
Sequelize in Saltarelle proposal
// library
[Imported]
[Reflectable]
public interface ISequelizeEntity { }
[Imported, IgnoreNamespace, ScriptName("Object")]
public abstract class SequelizeEntity : ISequelizeEntity
{
[ScriptSkip]
public SequelizeEntity() { } // prevent `Object.call(this);`
[IntrinsicProperty]
public int Id { get { return 0; } }
[IntrinsicProperty]
public DateTime? CreatedAt { get { return null; } }
[IntrinsicProperty]
public DateTime? UpdatedAt { get { return null; } }
}
// user code
public class MyEntity : SequelizeEntity
{
public string A;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment