Skip to content

Commit

Permalink
Move getting started page
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieJKendall committed Mar 8, 2020
1 parent e27d372 commit 914f78d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 29 deletions.
18 changes: 0 additions & 18 deletions docs/getting-started-sql.md
@@ -1,18 +0,0 @@
# Getting Started

This section outlines how to go from nothing to having a Snoozle-based REST API up and running.

!!! info "Prerequisites"
This section will assume the following:
- A (very) basic knowledge of C# and Visual Studio
- A compatible version of .NET installed
- Visual Studio installed (download the Community Edition for free [here](https://visualstudio.microsoft.com/downloads/))

# Choose your data provider

Snoozle provides an extensible set of base classes and interfaces that can be used to enable data persistence using a variety of technologies. The basic Snoozle package provides in-memory persistence, which is what this demo will use.

See the [data providers](data-providers.md) page for a full list.

# Create a new web project in Visual Studio

18 changes: 17 additions & 1 deletion docs/getting-started.md
@@ -1 +1,17 @@
# Snoozle
# Getting Started

This section outlines how to go from nothing to having a Snoozle-based REST API up and running.

!!! note "Prerequisites"
This section will assume the following:
- A (very) basic knowledge of C# and Visual Studio
- A compatible version of .NET installed
- Visual Studio installed (download the Community Edition for free [here](https://visualstudio.microsoft.com/downloads/))
# Choose your data provider

Snoozle provides an extensible set of base classes and interfaces that can be used to enable data persistence using a variety of technologies. The basic Snoozle package provides in-memory persistence, which is what this demo will use.

See the [data providers](data-providers.md) page for a full list.

# Create a new web project in Visual Studio

16 changes: 6 additions & 10 deletions docs/index.md
@@ -1,12 +1,6 @@
# Snoozle

The Snoozle framework removes the need for boilerplate code whilst providing fully-fledged REST APIs via simple model-based resource definitions. Behind the scenes, Snoozle uses the .NET expression tree API to dynamically write and compile highly optimised code based on your simple model definitions.

!!! info "Supported .NET Versions"
- .NET Core 2.1
- .NET Core 2.2
- .NET Core 3.0
- .NET Core 3.1
Snoozle removes the need for boilerplate code whilst providing fully-fledged REST APIs via simple model-based resource definitions. Behind the scenes, Snoozle uses the .NET expression tree API to dynamically write and compile highly optimised code based on your simple model definitions.

Snoozle aims to make the creation of fully customisable REST APIs accessible to software developers of all levels. Example use cases for Snoozle REST APIs are:

Expand All @@ -17,11 +11,12 @@ Snoozle aims to make the creation of fully customisable REST APIs accessible to

# Example

Setup and configuration of a Snoozle REST API is simple.
Setup and configuration of a Snoozle REST API is simple. All that is required is a resource model definition and a configuration class for each resource you want to expose via HTTP.

1. Define your data model, and implement the `IRestResource` marker interface
### Resource model

``` cs
// Inherit from the IRestResource interface to mark the class as a resource model
public class Cat : IRestResource
{
public int? Id { get; set; }
Expand All @@ -32,13 +27,14 @@ public class Cat : IRestResource
}
```

2. Create your resource configuration class that inherits from the abstract configuration builder
### Resource configuration

``` cs
public class CatResourceConfiguration : SqlResourceConfigurationBuilder<Cat>
{
public override void Configure()
{
// Define custom configurations for properties
ConfigurationForProperty(x => x.HairLength).HasColumnName("HairLengthInMeters");
ConfigurationForProperty(x => x.Id).HasColumnName("CatId").IsPrimaryIdentifier();
}
Expand Down

0 comments on commit 914f78d

Please sign in to comment.