Exemplo n.º 1
0
        private bool TryGetLastSuccessfullRead(ServiceContext context, out TimeoutManagerDataEntity lastSuccessfullReadEntity)
        {
            try
            {
                lastSuccessfullReadEntity = (from m in context.TimeoutManagerData
                                             where m.PartitionKey == Configure.EndpointName
                                             select m).FirstOrDefault();
            }
            catch
            {
                lastSuccessfullReadEntity = null;
            }


            return(lastSuccessfullReadEntity != null);
        }
Exemplo n.º 2
0
        private void UpdateSuccesfullRead(ServiceContext context, TimeoutManagerDataEntity read)
        {
            if (read == null)
            {
                read = new TimeoutManagerDataEntity(Configure.EndpointName, string.Empty)
                {
                    LastSuccessfullRead = DateTime.UtcNow
                };

                context.AddObject(ServiceContext.TimeoutManagerDataEntityTableName, read);
            }
            else
            {
                read.LastSuccessfullRead = DateTime.UtcNow;
                context.UpdateObject(read);
            }

            context.SaveChanges(SaveChangesOptions.ReplaceOnUpdate);
        }
Exemplo n.º 3
0
        private void UpdateSuccesfullRead(ServiceContext context, TimeoutManagerDataEntity read)
        {
            if (read == null)
            {
                read = new TimeoutManagerDataEntity(Configure.EndpointName, string.Empty){
                               LastSuccessfullRead = DateTime.UtcNow
                           };

                context.AddObject(ServiceContext.TimeoutManagerDataEntityTableName, read);
            }
            else
            {
                read.LastSuccessfullRead = DateTime.UtcNow;
                context.UpdateObject(read);
            }

            context.SaveChanges(SaveChangesOptions.ReplaceOnUpdate);
        }
Exemplo n.º 4
0
        private bool TryGetLastSuccessfullRead(ServiceContext context, out TimeoutManagerDataEntity lastSuccessfullReadEntity)
        {
            try
            {
                lastSuccessfullReadEntity = (from m in context.TimeoutManagerData
                                                 where m.PartitionKey == Configure.EndpointName
                                                 select m).FirstOrDefault();
            }
            catch
            {

                lastSuccessfullReadEntity = null;
            }

            return lastSuccessfullReadEntity != null;
        }