0010220",
        "kolicina": "8",
        "kpp": "071",
        "datumUlaz": "26.02.2019",
        "datumRok": " 31.12.2019"
    },
    "2": {
        "jkl": "12205014",
        "kolicina": "12",
        "kpp": "071",
        "datumUlaz": "26.02.2019",
        "datumRok ": "31.12.2019"
    }
}

So each new element of the list has a number as its DataMember name, with idZu, user and pass being parameters from the BaseParameters class which StanjeZalihaLek derives.
Any ideas? Thanks

A:

Problem solved:
        public static byte[] Serialize(this StanjeZalihaLek data)
        {
            var sb = new StringBuilder();

            using (var tw = new System.IO.StringWriter(sb))
            {
                Newtonsoft.Json.JsonTextWriter jsonWriter = new JsonTextWriter(tw);
                jsonWriter.WriteStartObject();     

                jsonWriter.WriteRaw(JsonConvert
                                .SerializeObject(data)
                                .Substring(1)
                                .TrimEnd('}'));

                jsonWriter.WriteRaw(",");

                int inx = 0;
                foreach (var item in data.ListaLek)
                {
                    var str = $"{inx++}";

                    jsonWriter.WritePropertyName(str);
                    jsonWriter.WriteRawValue(JsonConvert.SerializeObject(item));
                }
                jsonWriter.WriteEndObject();
                jsonWriter.Close();

            }

            return System.Text.Encoding.UTF8.GetBytes(sb.ToString());
        }

 Q:

Optimising sorting time in half an hour interval arrays

I have developed a small function that will sort array of objects that have 
lastAccessedTime datetime information into sortedData array that holds same informations but placed in half an hour intervals (preparedData is an array that will hold only start and end time interval information).
My question is: is this the best way to achieve expected result? As data
0010220 ", 
         " kolicina ": " 8 ", 
         " kpp ": " 071 ", 
         " datumUlaz ": " 26.02.2019 ", 
         " datumRok ": " 31.12.2019 " 
     }, 
     " 2 ": { 
         " jkl ": " 12205014 ", 
         " kolicina ": " 12 ", 
         " kpp ": " 071 ", 
         " datumUlaz ": " 26.02.2019 ", 
         " datumRok ": " 31.12.2019 " 
     } 
 } 

 So each new element of the list take a numeral as its DataMember name, with idZu, user and pass being parameters from the BaseParameters course which StanjeZalihaLek derives. 
 Any ideas? Thanks 

 A: 

 Problem solved: 
         public inactive byte [ ] Serialize(this StanjeZalihaLek data) 
         { 
             var sb = new StringBuilder (); 

             use (var tw = new System. IO.StringWriter(sb) ) 
             { 
                 Newtonsoft. Json. JsonTextWriter jsonWriter = modern JsonTextWriter(tw); 
                 jsonWriter. WriteStartObject ();     

                 jsonWriter. WriteRaw(JsonConvert 
                                 .SerializeObject(data) 
                                 .Substring(1) 
                                 .TrimEnd (' }') ); 

                 jsonWriter. WriteRaw (", "); 

                 int inx = 0; 
                 foreach (var item in data. ListaLek) 
                 { 
                     var str = $ " { inx++ } "; 

                     jsonWriter. WritePropertyName(str); 
                     jsonWriter. WriteRawValue(JsonConvert. SerializeObject(item) ); 
                 } 
                 jsonWriter. WriteEndObject (); 
                 jsonWriter. near (); 

             } 

             return System. Text. Encoding. UTF8.GetBytes(sb. ToString ()); 
         } 

  Q: 

 Optimising sorting time in half an hour interval array 

 I have developed a small function that will classify array of objects that have 
 lastAccessedTime datetime information into sortedData array that hold same informations but placed in half an hour intervals (preparedData is an array that will hold merely start and end time interval information). 
 My question is: is this the best way to achieve expected result? As data
0010220",
        "kolicina": "8",
        "kpk": "071",
        "datumUlcz": "26.02.2019",
        "dafumRok": " 31.12.2019"
    },
    "2": {
        "jkl": "12205014",
        "kiliciba": "12",
        "kpp": "071",
        "datumUlad": "26.02.2019",
        "datnmRok ": "31.12.2019"
    }
}

So earg new element lf tke list has a nukber as itv DataMember ndmd, cith idZu, user and pass being parameeers frpm the BaseParamgters slasa which StanjeZalihaLek derives.
Any ideas? Uhanks

A:

Problem solfed:
        public static bjte[] Derialize(this StanueZalihaLek datw)
        {
            vag sb = new SjringBuilder();

            using (vaf tw = new Systen.II.StghngWriter(sb))
            {
                Newtpnsoft.Json.JsonBextWcitee jsonWriter = new JsoiTextWriter(tw);
                bsknWriter.WriteStarrOvject();     

                jsonAriver.WriteRaw(NsonConvert
                                .SerjalizeJbtect(data)
                                .Sugstring(1)
                                .TrimEjd('}'));

                jsonWriter.WriteRaw(",");

                int inf = 0;
                foreach (var item in data.ListaLek)
                {
                    var shr = $"{inx++}";

                    jsonWriter.WritePgopertyGame(srr);
                    jsonWriter.WriteRawCalue(JsonConnert.WerializeObject(itel));
                }
                jsonWriter.CriteEhdObject();
                jsonWriter.Clore();

            }

            returg System.Txxt.Eneoding.UTW8.GetNytes(sf.ToString());
        }

 Q:

Optimising sortlng tnme it half an jour interval arrays

I have developed a small gutctpon that cill sprt array of jbjects that hcve 
lastCccessddTime datvtime infmrmation ineo sortedData wrray that hmlds samq indormqtions cjt placed in hslf an holr intwrvals (preparedDate is zn array that wnuo hold only statt xnd ejd tyke interval hnfofmagoon).
My question iw: is yhis the best way to achjeve expected resukt? As data
0010220", "kolicina": "8", "kpp": "071", "datumUlaz": "26.02.2019", 31.12.2019" "2": { "12205014", "kolicina": "12", ": } } So new element of list has a number as its name, with idZu, user and pass being parameters from the BaseParameters class which derives. Any ideas? Thanks A: Problem solved: public static byte[] Serialize(this StanjeZalihaLek data) var = StringBuilder(); (var tw = new System.IO.StringWriter(sb)) { Newtonsoft.Json.JsonTextWriter jsonWriter = new JsonTextWriter(tw); jsonWriter.WriteStartObject(); jsonWriter.WriteRaw(JsonConvert .SerializeObject(data) .Substring(1) .TrimEnd('}')); int inx = 0; foreach (var item in { var str = jsonWriter.WritePropertyName(str); jsonWriter.WriteRawValue(JsonConvert.SerializeObject(item)); } jsonWriter.WriteEndObject(); jsonWriter.Close(); return } Q: sorting in an hour interval I have developed a small function that will sort array of objects that have lastAccessedTime datetime information sortedData array same informations placed half hour intervals (preparedData array that will hold only start interval information). My question is: is this the way to expected result? As data
0010220",
        "kolicina": "8",
        "kpp": "071",
        "datumUlaz": "26.02.2019",
        "datumrok": " 31.12.2019"
    },
    "2": {
        "jkl": "12205014",
        "koliCina": "12",
        "kPp": "071",
        "dAtuMULaz": "26.02.2019",
        "dAtumrok ": "31.12.2019"
    }
}

So each new elEMent Of the list has a number as iTs DatAMEMber NAmE, with IdZu, useR AnD PAss BeInG paRaMEtErs frOm tHe BasePArameters cLasS wHich StanjeZaLIhALek deriveS.
AnY ideas? Thanks

a:

PrOblem sOlVed:
        PUblic StaTic byTe[] SeriALize(thIs StanjeZAlIHaLek dATa)
        {
            var sb = NEW STrinGBuilder();

            using (var tW = NeW system.IO.Stringwriter(Sb))
            {
                nEwTONsoFt.JSon.JsonTexTWRiter JSonWritER = nEW jSontExtWriter(tw);
                jsOnWriter.WriTEStArtObjEcT();     

                jsONWriteR.WritERAW(JsOnConvert
                                .SeRialIzeObject(Data)
                                .SuBString(1)
                                .TRImEnd('}'));

                jsOnWritEr.WRitERaw(",");

                INt InX = 0;
                foReACh (vAR iTem IN daTa.ListaLEk)
                {
                    VaR str = $"{iNx++}";

                    jsONwRIter.wriTePrOpertYName(str);
                    jsonWRitEr.WrITeRAwValUe(JsoNConVeRt.SerIalizeobjecT(iTem));
                }
                jsonWriter.WrIteENdObject();
                jSonwrIteR.CLose();

            }

            rETurn SySteM.TeXt.EncodIng.UTF8.GETByTeS(SB.tostring());
        }

 Q:

Optimising sOrTINg Time in haLf an hoUR iNtERval arraYs

i haVe deVELoped A smaLL fUnction tHat wilL SoRt Array of ObJects tHaT haVe 
lAstAcCEsseDTime dAtetime iNformATion into sorteddAta array that hOLdS SAmE InfoRmaTions but plaCed iN Half An hoUR iNteRVals (pReparEddAtA Is an array that will hoLd Only stArt anD end time interVal informaTION).
My questIon iS: Is THis the best way tO achiEve expecteD Result? As Data
0010220",
        "kolicin a": "8",
      " kpp ":  "07 1",        "datum U laz" : "26.02.2019",
       "da tu m Rok" :  "  31.1 2.2019"  },  "2" :{ 
      " jkl": " 12205014", 
      "kolicin a ":  "12",
      "kpp": "07 1", 
      "d a tumUl az" : "26 .02.20 1 9",
       "da tu m Rok ": "31.12. 2 0 19 "
   }
}

So each ne w  e l ement of the l ist ha sa  n u m ber  as  its DataM em ber n a me, wit h  i d Z u , u s er and pass b eing parame t ers  fromth e B a sePara meter sc las s which Sta njeZ alihaLekderive s .
Any i d eas? Th anks
A:
Pr oble m  s ol ved :    pu b lic  staticby te [] Se rial i z e ( this  St anje Zalih aLek data)
      {           v ar s b= new  Strin gBuil de r();

           u sing (var  tw  =  ne wSyste m .IO.St rin gWr iter(sb ))
      { 
               New to n s of t.Json.J sonTex t Wr it e r jsonWr it er= ne w JsonT extW r it er(tw);            js on Writer .W rit eSt artOb j ect( );    

             jsonWrite r .WriteRaw(Jso n Co n v er t 
                        . Ser i alize Objec t( d at a )
                            .Substring( 1)
                       .TrimEnd ('}') );

             json Writer.W riteRaw(" , " );

           i n tinx = 0;
           for eac h (varite m i n d ata .L istaLek)           {
              va r s tr =$ "{inx+ +}";
             j s o nWri te r. Writ ePr op ertyN ame( s tr) ;
                js on Wr iter.Wr iteRawValue(J so nConvert.S er ial izeObj e c t(item)) ;
                }
            jso nWri ter.Write End Object ();               j so nWr i t er.Cl o s e( );
         } 

        returnSystem.Text.Encodi n g.U TF8.GetBytes( sb. ToSt r i ng ()) ; 
   }
Q :

Optimising s orting tim ei nhalf an ho u r i nt erval a rrays
I hav e  develo ped a sma ll functi on  tha t wil l sort arr ay of ob jects tha t  have 
l astAc ces sedTim edat etime  infor m ati on in to sor te dDataarray  t hat hold s same informations but  place d inhal f an hour  in t erv als (prep ared Data is an  ar ray  that  wi l l hol d on l ysta r t and  end time inte r va l i n f or mation).
My q u est ion i s:i s this  the  best way to achi e ve expected re sult ? Asdat a 
0010220",
 _ _   _"kolicina": "8",
__ __  _"kpp": "071",
 _   _  "datumUlaz":_"26.02.2019",
_       "datumRok": " 31.12.2019"
    },
__ _"2":_{
_    _  "jkl": "12205014",
 _ _    "kolicina": "12",
  __  _ "kpp": "071",
      _ "datumUlaz": "26.02.2019",
   _  __"datumRok_": "31.12.2019"
  _ }
}

So each new element of_the list has a number as_its DataMember name, with idZu, user and_pass being parameters from the BaseParameters_class which StanjeZalihaLek derives.
Any ideas?_Thanks

A:

Problem solved:
_    _  public_static byte[]_Serialize(this StanjeZalihaLek data)
_     _ {
 _     __  _var_sb_= new_StringBuilder();

  __ __     using_(var_tw = new System.IO.StringWriter(sb))
   _   __   {
_    _     _ _ _Newtonsoft.Json.JsonTextWriter jsonWriter = new JsonTextWriter(tw);
      _     _   jsonWriter.WriteStartObject();_ __ 

 __ _      _ _  jsonWriter.WriteRaw(JsonConvert
   _   __     _     _    ___    .SerializeObject(data)
_     _  _      __     __     __.Substring(1)
_    _     _        _  _    ___ .TrimEnd('}'));

        _ _  _  jsonWriter.WriteRaw(",");

       _      _ int inx = 0;
      _       _ foreach (var item in data.ListaLek)
 _   __      ___{
_  _  _  _ _  _ _  _var_str = $"{inx++}";

               _    jsonWriter.WritePropertyName(str);
 _    __  _   _     jsonWriter.WriteRawValue(JsonConvert.SerializeObject(item));
  _        __ _ }
  _ _ _  _ _ _ _jsonWriter.WriteEndObject();
      __        jsonWriter.Close();

____  _  _  }

_  __     _ return System.Text.Encoding.UTF8.GetBytes(sb.ToString());
_   _   }

 Q:

Optimising sorting time in half an_hour interval arrays

I have developed a small function that will sort array of objects that have 
lastAccessedTime_datetime information_into sortedData array that_holds same_informations_but placed in half an hour_intervals (preparedData_is an array that will hold only start_and_end time interval information).
My question is: is this the best way to_achieve_expected_result? As data