Camalot.Common is a collection of classes, extensions and other things that I have written over the years that I used to find myself copying the files in to my projects every time I created them.
Well, I think you found that one already...
Available on nuget
PS> Install-Package Camalot.Common
- There are way too many to list here. Go check out the source.
- JsonSerializationBuilder : This creates a Newtonsoft.Json Serializer
- XmlSerializationBuilder : This creates an XmlSerializer
There are additional libraries that are specifically built for ASPNET MVC. Support for versions MVC3, MVC4, MVC5.
Well, I think you found that one already...
Available on nuget
PS> Install-Package Camalot.Common.Mvc3
PS> Install-Package Camalot.Common.Mvc4
PS> Install-Package Camalot.Common.Mvc5
###Attributes (Camalot.Common.Mvc.Attributes)
- AjaxOnly : The Action is only to be called via ajax.
- NoCache : The Action will not be cached. This is good to use with AjaxOnly.
- Compress : If the browsers supports it, the respose will be gzipped or commpressed using DEFLATE.
- AjaxValidateAntiForgeryToken : This allows you to post JSON via ajax, and pass an Anti-Forgery Token along in the request headers. This can be used if you are posting normally with a Form as well.
- JsonResult<T> : Like the default JsonResult, except it uses Newtonsoft JSON.NET
- JsonpResult<T> : Support JSONP responses
- XmlResult<T> : Xml Serialization Result
- BundleCollection
- LoadFromWebConfiguration : This loads Script/Style bundles from the web.config. See the <camalot.common/bundles> section in the web.config for samples. In the BundleConfig you can delete it all and just call this method and be done.
- Controller
- JSON<T>(T data) : A clean serialization of an object to JSON
- JSONP<T>(T data [, callback]) : Support for JSONP Action Result.
- XML<T>(T data) : A clean serialization of an object to XML