Beispiel #1
0
        protected void Process(string requestBody)
        {
            try
            {
                // break into lines
                var lines = requestBody.Split(new string[] { "\r\n" }, StringSplitOptions.None);

                // handle each line with a method
                ProcessRequestLine(lines[0]);
                var lastLine = 1;
                IEnumerableExtenders.ForEach <string>(lines
                                                      .Skip(1)
                                                      .TakeWhile(x => !string.IsNullOrEmpty(x)), x =>
                {
                    Headers.Add(x);
                    lastLine++;
                });

                if (lastLine < lines.Length)
                {
                    Body = string.Join("\r\n", lines.Skip(lastLine + 1));
                }
            }
            catch (Exception ex)
            {
                throw new HttpServerException("Cannot process poorly formed client request. \r\n {0}".AsFormat(requestBody));
            }
        }
Beispiel #2
0
 public void Insert <TEntity>(IEnumerable <TEntity> list) where TEntity : T
 {
     IEnumerableExtenders.ForEach(list, Insert);
 }
Beispiel #3
0
        public void Delete <TEntity>(ISearchCriteria <TEntity> criteria) where TEntity : T
        {
            var session = GetCurrentSession();

            IEnumerableExtenders.ForEach(FindAll(criteria), session.Delete);
        }