This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| user=$EUID | |
| if [ "${user}" != "0" ]; then | |
| echo | |
| echo "$0 must be run as root - you are running as $EUID" | |
| echo | |
| exit 1 | |
| fi | |
| echo | |
| echo "About to destroy Rancher 2.x install" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Convert .Net Type to SqlDbType or DbType and vise versa | |
| //This class can be useful when you make conversion between types .The class supports conversion between .Net Type , SqlDbType and DbType . | |
| using System; | |
| using System.Collections; | |
| using System.Data; | |
| namespace Devintelligence.Common.Data | |
| { | |
| /// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class CategoryController : Controller | |
| { | |
| private TodoDataContext db = new TodoDataContext(); | |
| // | |
| // GET: /Category/ | |
| public ViewResult Index() | |
| { | |
| return View(db.Categories.ToList()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MyMetadataSource : FluentMetadataSource | |
| { | |
| protected override Telerik.OpenAccess.Metadata.MetadataContainer CreateModel() | |
| { | |
| var container = base.CreateModel(); | |
| container.NameGenerator.UseDefaultMapping = true; | |
| return container; | |
| } | |
| protected override IList<MappingConfiguration> PrepareMapping() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)] | |
| [JSONPSupportBehavior] | |
| public partial class NorthwindService : OpenAccessDataService<KendoUIOAOData.EntitiesModel> | |
| { | |
| //Rest of code omitted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DefaultModel.RegisterContext(new OpenAccessDataModelProvider(new EntitiesModel() /*the name of your OpenAccess Context*/, | |
| () => new EntitiesModel() /*the name of your OpenAccess Context*/), | |
| new ContextConfiguration { ScaffoldAllTables = false }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class EnumToStringConverter<TEnum> : Telerik.OpenAccess.Data.AdoTypeConverter where TEnum : struct | |
| { | |
| /// <summary> | |
| /// Reads data from the data reader into the type | |
| /// </summary> | |
| /// <param name="holder">A place where the read data can be stored unboxed</param> | |
| /// <returns>Value that was read or <c>null</c> when boxing is turned off</returns> | |
| public override object Read(ref DataHolder holder) | |
| { | |
| return null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class DataReaderExtensions | |
| { | |
| public static List<dynamic> ToDynamicList(this IDataReader reader) | |
| { | |
| var result = new List<dynamic>(); | |
| while (reader.Read()) | |
| { | |
| ExpandoObject item = new ExpandoObject(); | |
| var itemDictionary = item as IDictionary<string, object>; | |
| for (int i = 0; i < reader.FieldCount; i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Varchar2IntConverter : Telerik.OpenAccess.Data.AdoTypeConverter | |
| { | |
| //create flag to mark whether the CLR type is nullable or not | |
| private bool nullable; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public override Type DefaultType | |
| { | |
| get { return typeof(int); } | |
| } |
NewerOlder