AppActs.API.Model.Error.Error.Add C# (CSharp) Method

Add() public method

public Add ( DeviceInfo device ) : void
device AppActs.API.Model.Device.DeviceInfo
return void
        public void Add(DeviceInfo device)
        {
            this.Model = device.Model;
            this.OsVersion = device.OperatingSystem;
            this.PlatformId = device.PlatformType;
        }

Usage Example

        public void Log(Error error)
        {
            Application application = this.applicationRepository.Find(error.ApplicationId);

            if (application != null)
            {
                DeviceInfo device = this.deviceRepository.Find(error.DeviceId);

                if (device != null)
                {
                    error.Add(device);

                    ErrorSummary errorSummary = new ErrorSummary(error);

                    this.errorRepository.Save(error);
                    this.errorRepository.Save(errorSummary);
                }
                else
                {
                    throw new NoDeviceException(error.DeviceId);
                }
            }
            else
            {
                throw new InactiveApplicationException(error.ApplicationId);
            }
        }