internal void SaveValue(DTOs.External.DeviceValue value) { tKovanContext ctx = new tKovanContext(); Models.EntityClass.DeviceValue deviceValue = new Models.EntityClass.DeviceValue(); deviceValue = Utilities.Map <TeknolojiKovaniWebApi.Domain.Values.DTOs.External.DeviceValue, TeknolojiKovaniWebApi.Models.EntityClass.DeviceValue>(value, deviceValue); deviceValue.DataServerTime = DateTime.UtcNow.AddHours(3); deviceValue.DataDeviceTime = DateTime.UtcNow.AddHours(3); ProfileDomain profileDomain = new ProfileDomain(); PropertyRead property = profileDomain.GetProperty(value.PropertyName); deviceValue.PropertyId = property.Id; DeviceDomain deviceDomain = new DeviceDomain(); DeviceRead device = deviceDomain.GetDevice(value.DeviceId); deviceValue.EnvironmentId = device.EnvironmentId.Value; deviceValue.UserId = device.UserId; ctx.DeviceValue.Add(deviceValue); ctx.SaveChanges(); }
// ///////////////////////////////////////////////////////////////////////////////////////// public static ProfileDomain GetProfile1() { ProfileDomain profile = new ProfileDomain { UserId = 1, Location = "Los Angeles", Biogrphy = "I am a back-end dev with a degree in Computer Science.", Experience = "", Education = "Bachelors", Username = "******", MemberSince = "January 2016", PageUrl = "https://angrysox99.com", CodeSamples = new List <string>() }; profile.CodeSamples.Add("http://fabacademy.org/archives/2012/students/chibire.terence/images/samplecode_1.PNG"); profile.CodeSamples.Add("http://www.tapkaa.com/wp-content/uploads/2013/02/Sample-Pre-Paid-SIM-Card-Class-to-teach-C++-Inheritance.png"); profile.CodeSamples.Add("https://www.phpclasses.org/browse/view/image/format/screenshot/file/36680/name/paypal-php-class-library-get-balance-code-sample.jpg"); return(profile); }
/// <summary> /// Construtor referente ao controller do Módulo Usuário /// </summary> public UserController(SysQueirozContext context) { userDomain = new UserDomain(context); profileDomain = new ProfileDomain(context); menuDomain = new MenuDomain(context); }
public ProfileController() { _profileDomain = new ProfileDomain(); }