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
| using System.Collections.Generic; | |
| using EntityFrameworkExamples.Data; | |
| using EntityFrameworkExamples.Models; | |
| namespace EntityFrameworkExamples.Services | |
| { | |
| public class UserService | |
| { | |
| private readonly ApplicationContext _context; |
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
| using System.ComponentModel.DataAnnotations.Schema; | |
| using System.Data.Entity.ModelConfiguration; | |
| using EntityFrameworkExamples.Models; | |
| namespace EntityFrameworkExamples.Mappings | |
| { | |
| class UserMapping : EntityTypeConfiguration<User> | |
| { | |
| public UserMapping() | |
| { |
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
| using System.Data.Entity; | |
| using EntityFrameworkExamples.Models; | |
| namespace EntityFrameworkExamples.Data | |
| { | |
| public class ApplicationContext : DbContext | |
| { | |
| public virtual IDbSet<User> Users { get; set; } | |
| public ApplicationContext() |
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
| namespace EntityFrameworkExamples.Models | |
| { | |
| public class User | |
| { | |
| public long Id { get; set; } | |
| public string Username { get; set; } | |
| public string Password { get; set; } | |
| } |
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 UserService | |
| { | |
| private readonly ApplicationContext _context; | |
| public UserService(ApplicationContext context) | |
| { | |
| _context = context; | |
| } | |
| public IEnumerable<User> GetUsers() |
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 UserService | |
| { | |
| public IEnumerable<User> GetUsers() | |
| { | |
| var ds = new DataSet(); | |
| using (var con = new SqlConnection("Server=myServerAddress;Database=myDataBase;UserId=myUsername;Password=myPassword;")) | |
| { | |
| using (var da = new SqlDataAdapter("SELECT * FROM Users", con)) | |
| { |
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
| using GHIElectronics.NETMF.FEZ; | |
| using Microsoft.SPOT; | |
| using Microsoft.SPOT.Hardware; | |
| using System; | |
| namespace Keypad_Test | |
| { | |
| public class Program | |
| { | |
| static Cpu.Pin[] ColumnPins = new[] |
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 char[] GetKeys() | |
| { | |
| var s = ""; | |
| for (var i = 0; i < ColumnPins.Length; i++) | |
| { | |
| using (var output = new OutputPort(ColumnPins[i], false)) | |
| { | |
| for (var j = 0; j < RowPins.Length; j++) | |
| { |
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
| using Microsoft.SPOT.Hardware; | |
| namespace Keypad_Test | |
| { | |
| class Keypad | |
| { | |
| public char[][] Keymap | |
| { | |
| get; | |
| private set; |
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 sealed class TestConfig : RegistryConfig | |
| { | |
| public string TestSetting1 | |
| { | |
| get | |
| { | |
| return GetValue(ParsePropertyMethodName(MethodBase.GetCurrentMethod().Name), string.Empty); | |
| } | |
| set | |
| { |