Ejemplo n.º 1
0
        public SegmentEventsEntry GetSegmentEventsObject(string eve, double inn, double outt, int segid, string time)
        {
            var obj = new SegmentEventsEntry();

            obj.EventType  = eve;
            obj.FlowIn     = inn;
            obj.FlowOut    = outt;
            obj.SegmentsId = segid;
            obj.TimeStamp  = Convert.ToDateTime(time);
            return(obj);
        }
Ejemplo n.º 2
0
        public async Task AddSegmentEvent([FromBody] SegmentEventsEntry value)
        {
            try
            {
                await _db.SegmentEvents.AddAsync(value);

                await _db.SaveChangesAsync();
            }
            catch (Exception e)
            {
                Console.WriteLine("error", e);
            }
        }
Ejemplo n.º 3
0
        public async Task UpdateSegmentEvent(int id, [FromBody] SegmentEventsEntry value)
        {
            try
            {
                var old = await _db.SegmentEvents.FindAsync(id);

                _db.Entry(old).CurrentValues.SetValues(value);
                await _db.SaveChangesAsync();
            }
            catch (Exception e)
            {
                Console.WriteLine("error", e);
            }
        }