<commit_before>#Vault for Umbraco 6 and 7

### Build Status:

| Branch | Status |
| ------ | ------ |
| master | [![Build status](https://ci.appveyor.com/api/projects/status/4lmny3neenc4hibj?svg=true)](https://ci.appveyor.com/project/TheNerdery/umbracovault) |
| develop | [![Build status](https://ci.appveyor.com/api/projects/status/4lmny3neenc4hibj/branch/develop?svg=true)](https://ci.appveyor.com/project/TheNerdery/umbracovault/branch/develop) |

## Overview
Vault for Umbraco is an easy-to-use, extensible ORM to quickly and easily get strongly-typed Umbraco CMS data into your
 markup.  It allows you to create lightly-decorated classes that Vault will understand how to hydrate. This gives you
 the full view model-style experience in Umbraco that you are accustomed to in MVC, complete with strongly-typed view
 properties (no more magic strings in your views).

## The Idea

let's assume we have a document type with the alias `BlogEntry` set up with the following properties:

Property Name | Alias | Type
--- | --- | ---
Title | title | Textstring
PostedDate | postedDate | Date Picker
Content | content | Richtext editor

We can create a class for this document type:

```csharp
[UmbracoEntity(AutoMap = true)]
public class BlogEntryViewModel
{
	public string Title { get; set; }
	public DateTime PostDate { get; set; }

	[UmbracoRichTextProperty(alias="bodyContent")]
	public string Content { get; set; }
	
	public MediaItem Image { get; set; }	
}
```

This model can now get injected into our views with our fancy `VaultDefaultGenericController`. Now our views look like this:


```
  @inherits Umbraco.Web.Mvc.UmbracoTemplatePage

  <h1>@Model.Title</h1>
  <img src="@Model.Image.Url" alt="@Model.Image.AltText" />
  <div>@Model.PostDate.ToShortDateString()</div>
  <div>@Html.Raw(Model.Content)</div>	

```

Much cleaner, with compile time checking. Reads nicer than the usual `@Umbraco.Field("bodyContent")`

Want to learn more? Check out the wiki!

## Nuget Installation

```PowerShell
PM> Nuget.exe Sources Add -Name UmbracoVaultBuild -Source https://ci.appveyor.com/nuget/umbracovault-5m6ate96gcwx -UserName <appveyoremail> -Password <<PASSWORD>>
PM> Install-Package UmbracoVault -Source UmbracoVaultBuild
```

## Extensibility

UmbracoVault was built to be extensible to other Umbraco package developers. What good is an ORM if it doesn't support
 other native object types? Please see our documentation on 
 [how to extend Vault](https://github.com/kensykora/UmbracoVault/wiki/Extending-Vault) for your own Umbraco packages.

## Credits
<commit_msg>Fix View Example<commit_after>#Vault for Umbraco 6 and 7

### Build Status:

| Branch | Status |
| ------ | ------ |
| master | [![Build status](https://ci.appveyor.com/api/projects/status/4lmny3neenc4hibj?svg=true)](https://ci.appveyor.com/project/TheNerdery/umbracovault) |
| develop | [![Build status](https://ci.appveyor.com/api/projects/status/4lmny3neenc4hibj/branch/develop?svg=true)](https://ci.appveyor.com/project/TheNerdery/umbracovault/branch/develop) |

## Overview
Vault for Umbraco is an easy-to-use, extensible ORM to quickly and easily get strongly-typed Umbraco CMS data into your
 markup.  It allows you to create lightly-decorated classes that Vault will understand how to hydrate. This gives you
 the full view model-style experience in Umbraco that you are accustomed to in MVC, complete with strongly-typed view
 properties (no more magic strings in your views).

## The Idea

let's assume we have a document type with the alias `BlogEntry` set up with the following properties:

Property Name | Alias | Type
--- | --- | ---
Title | title | Textstring
PostedDate | postedDate | Date Picker
Content | content | Richtext editor

We can create a class for this document type:

```csharp
[UmbracoEntity(AutoMap = true)]
public class BlogEntryViewModel
{
	public string Title { get; set; }
	public DateTime PostDate { get; set; }

	[UmbracoRichTextProperty(alias="bodyContent")]
	public string Content { get; set; }
	
	public MediaItem Image { get; set; }	
}
```

This model can now get injected into our views with our fancy `VaultDefaultGenericController`. Now our views look like this:


```
  @model BlogEntryViewModel

  <h1>@Model.Title</h1>
  <img src="@Model.Image.Url" alt="@Model.Image.AltText" />
  <div>@Model.PostDate.ToShortDateString()</div>
  <div>@Html.Raw(Model.Content)</div>	

```

Much cleaner, with compile time checking. Reads nicer than the usual `@Umbraco.Field("bodyContent")`

Want to learn more? Check out the wiki!

## Nuget Installation

```PowerShell
PM> Nuget.exe Sources Add -Name UmbracoVaultBuild -Source https://ci.appveyor.com/nuget/umbracovault-5m6ate96gcwx -UserName <appveyoremail> -Password <<PASSWORD>>
PM> Install-Package UmbracoVault -Source UmbracoVaultBuild
```

## Extensibility

UmbracoVault was built to be extensible to other Umbraco package developers. What good is an ORM if it doesn't support
 other native object types? Please see our documentation on 
 [how to extend Vault](https://github.com/kensykora/UmbracoVault/wiki/Extending-Vault) for your own Umbraco packages.

## Credits

{'fraction_non_alphanumeric': 0.11215135556855861, 'fraction_numerical': 0.005461283401599376, 'mean_word_length': 4.573913043478261, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 27, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4751054', 'n_tokens_mistral': 1692, 'n_tokens_neox': 1598, 'n_words': 516}